@import url('https://fonts.googleapis.com/css?family=Quicksand&display=swap');
@import url('/styles/base.css');
@import url('/styles/layout.css');
@import url('/styles/components.css');
:root {
  /* Define CSS variables for colors */
  --primary-color: #f1f1f3;
  --app-primary-color: #794bff;
  --app-primary: var(--app-primary-color);
  --app-confirm-color: var(--app-primary-color);
  --secondary-color: var(--app-primary-color);
  --app-kpi-color: #794bff;
  --accent-color: #ffc107;
  --success-color: #28a745;
}

*{
  font-family:Quicksand;
}

body {
    background-color: var(--primary-color)!important;
    padding-top: 56px;
}

.containerCustom {
  max-width: fit-content!important;
}

/*
main {
    padding-top: 56px;
}

@media (min-width: 576px) {
  main {
    padding-top: 64px;
  }
}
*/

.col-6 {
  margin-bottom: 1rem;
}

.bg-dark {
  background-color: var(--secondary-color)!important; /*rgb(0, 57, 66)!important;*/
}

/*
.mt-4 {
  margin-top: 0.5rem!important;
}
*/

button, .btn {
  border: none!important;
  border-radius: 18px!important;
  box-shadow: 2px 4px 12px rgba(0,0,0,.08);
  font-weight: bold!important;
}
.btn-primary,
.btn-info,
.btn-success {
  background-color: var(--app-primary-color, var(--secondary-color))!important;
  border-color: var(--app-primary-color, var(--secondary-color))!important;
  color: #fff !important;
}

.btn-primary:focus,
.btn-info:focus,
.btn-success:focus,
.btn-primary.focus,
.btn-info.focus,
.btn-success.focus {
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--app-primary-color, #794bff) 24%, transparent) !important;
}

select {
  border: none!important;
  border-radius: 18px!important;
  box-shadow: 2px 4px 12px rgba(0,0,0,.08);
}

input {
  border: none!important;
  border-radius: 18px!important;
  box-shadow: 2px 4px 12px rgba(0,0,0,.08);
}

.btn .badge {
  border: none!important;
  border-radius: 18px!important;
  box-shadow: 2px 4px 12px rgba(0,0,0,.08);
}

.input-group-append {
  margin-left: 0;
  z-index: 1;
  border: none !important;
  border-radius: 18px !important;
}

/* BOM and material consumption */
.bom-page .bom-items-card,
.bom-page .bom-consumption-card,
.ws-material-scan-card,
.ws-material-section-card {
  background: var(--container-bg, #fff);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 22px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.07);
}

.bom-page .bom-items-card,
.bom-page .bom-consumption-card {
  padding: 22px;
}

.bom-edit-page {
  padding-bottom: 36px !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

body.has-app-sidebar main.bom-edit-page {
  height: auto !important;
  min-height: 100dvh !important;
  max-height: none !important;
  overflow: visible !important;
}

.bom-edit-page .bom-form-card,
.bom-edit-page .bom-items-card,
.bom-edit-page > .app-card:last-child {
  width: min(100%, 1500px);
}

.bom-edit-page .bom-items-card {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  max-height: none;
  overflow: visible;
}

.bom-edit-page .bom-items-card .app-card-header {
  flex: 0 0 auto;
  margin-bottom: 14px;
}

.bom-edit-page .bom-items-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
  padding: 2px 6px 2px 2px;
}

.bom-edit-page .bom-item-grid {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(260px, 2fr) minmax(130px, 0.8fr) minmax(140px, 0.9fr);
  gap: 14px;
  align-items: end;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.68);
}

.bom-edit-page .bom-item-grid .form-group {
  min-width: 0;
  margin-bottom: 0;
}

.bom-edit-page .bom-item-grid label {
  display: block;
  color: var(--muted-color, #64748b);
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 7px;
}

.bom-edit-page .bom-switch-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(145px, 1fr));
  gap: 10px 14px;
  align-items: center;
}

.bom-edit-page .bom-switch-row .app-switch-row {
  margin: 0;
  white-space: nowrap;
}

.bom-edit-page .bom-item-submit {
  align-self: center;
}

.bom-edit-page .bom-items-table-wrap {
  margin-top: 16px;
  max-height: min(48dvh, 520px);
  overflow: auto;
}

.bom-edit-page .bom-items-table-wrap .app-table {
  min-width: 860px;
}

@media (max-width: 1199.98px) {
  .bom-edit-page .bom-items-card {
    max-height: none;
    overflow: visible;
  }

  .bom-edit-page .bom-items-scroll {
    overflow: visible;
    padding-right: 0;
  }

  .bom-edit-page .bom-item-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bom-edit-page .bom-switch-row {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(145px, 1fr));
  }
}

@media (max-width: 575.98px) {
  .bom-edit-page .bom-items-card,
  .bom-edit-page .bom-consumption-card {
    padding: 16px;
  }

  .bom-edit-page .bom-item-grid {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .bom-edit-page .bom-switch-row {
    grid-template-columns: 1fr;
  }
}

.ws-materials-panel {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.ws-materials-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 16px;
  height: 100%;
  min-height: 0;
  min-width: 0;
}

.ws-material-scan-card,
.ws-material-section-card {
  padding: 18px;
}

.ws-material-scan-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  min-width: 0;
}

.ws-material-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.ws-material-section-card {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ws-material-tables-card {
  height: 100%;
}

.ws-material-card-head,
.ws-material-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.ws-material-card-head strong,
.ws-material-section-head strong {
  display: block;
  font-size: 1.05rem;
}

.ws-material-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.ws-material-bom-panel {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.72);
  overflow: hidden;
  flex: 0 0 auto;
  transition: width 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.ws-material-bom-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  color: var(--app-text);
  text-align: left;
}

.ws-material-bom-toggle span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ws-material-bom-toggle small {
  color: var(--muted-color, #64748b);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ws-material-bom-toggle strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}

.ws-material-bom-toggle i {
  transition: transform 0.18s ease;
}

.ws-material-bom-panel.is-collapsed .ws-material-bom-toggle i {
  transform: rotate(-90deg);
}

.ws-material-bom-panel.is-collapsed {
  width: 44px;
  border-color: transparent;
  background: transparent;
}

.ws-material-bom-panel.is-collapsed .ws-material-bom-toggle {
  width: 44px;
  height: 44px;
  padding: 0;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.ws-material-bom-panel.is-collapsed .ws-material-bom-toggle span {
  display: none;
}

.ws-material-bom-body {
  display: grid;
  gap: 10px;
  padding: 0 13px 13px;
}

.ws-material-bom-panel.is-collapsed .ws-material-bom-body {
  display: none;
}

.ws-material-bom-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  min-width: 0;
}

.ws-material-bom-row .btn {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border-radius: 16px;
}

.ws-material-tabs-head {
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.ws-material-subtabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 5px;
  border-radius: 18px;
  background: rgba(226, 232, 240, 0.62);
}

.ws-material-subtabs .nav-link {
  width: 100%;
  min-height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.45rem 0.75rem;
  color: var(--app-muted);
  font-weight: 800;
  white-space: nowrap;
  min-width: 0;
}

.ws-material-subtabs .nav-link span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-material-subtabs .nav-link.active {
  background: var(--container-bg, #fff);
  color: var(--app-text);
  box-shadow: var(--app-shadow-soft);
}

.ws-material-tab-content,
.ws-material-table-pane {
  flex: 1 1 auto;
  min-height: 0;
}

.ws-material-tab-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ws-material-table-pane.active {
  display: flex;
  flex-direction: column;
}

.ws-material-scan-input {
  font-size: 1.02rem;
  min-height: 48px;
}

.ws-material-scan-buffer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 14px;
  background: rgba(59, 130, 246, 0.08);
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.ws-material-scan-buffer strong {
  color: var(--text-color);
}

.ws-material-scan-buffer .btn {
  padding: 4px 9px;
  min-height: 28px;
  border-radius: 999px;
  font-size: 0.72rem;
}

.ws-material-scan-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0 16px;
}

.ws-material-manual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ws-material-manual-grid label,
.ws-material-scan-card label {
  min-width: 0;
  color: var(--muted-color, #64748b);
  font-size: 0.84rem;
  font-weight: 700;
}

.ws-material-decode-preview {
  margin-top: 14px;
}

.ws-material-decode-card {
  border: 1px dashed rgba(0, 123, 255, 0.28);
  border-radius: 16px;
  padding: 14px;
  background: rgba(0, 123, 255, 0.05);
}

.ws-material-decode-card.is-ok {
  border-color: rgba(34, 197, 94, 0.42);
  background: rgba(34, 197, 94, 0.08);
}

.ws-material-decode-card.is-warning {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.1);
}

.ws-material-decode-card.is-error {
  border-color: rgba(239, 68, 68, 0.42);
  background: rgba(239, 68, 68, 0.08);
}

.ws-material-decode-card strong {
  display: block;
  word-break: break-word;
}

.ws-material-decode-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ws-material-decode-title {
  min-width: 0;
}

.ws-material-decode-title strong {
  margin-top: 2px;
}

.ws-material-match-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 25px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
  white-space: nowrap;
}

.ws-material-match-badge.is-ok {
  color: #047857;
  background: rgba(16, 185, 129, 0.14);
}

.ws-material-match-badge.is-warning {
  color: #92400e;
  background: rgba(245, 158, 11, 0.16);
}

.ws-material-match-badge.is-error {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.14);
}

.ws-material-match-lines {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.ws-material-match-line {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: var(--app-muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.ws-material-match-line i {
  margin-top: 2px;
}

.ws-material-decode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.ws-material-decode-grid span {
  display: grid;
  gap: 2px;
  min-width: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  padding: 8px;
}

.ws-material-decode-grid span.is-missing {
  border: 1px dashed rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.06);
}

.ws-material-decode-grid b {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ws-material-decode-grid small {
  color: var(--muted-color, #64748b);
  font-weight: 700;
  text-transform: uppercase;
}

.ws-material-progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9edf2;
  min-width: 120px;
}

.ws-material-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--success-color, #28a745);
}

.ws-material-requirements-wrap,
.ws-material-consumption-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
}

.ws-material-requirements-wrap .app-table,
.ws-material-consumption-wrap .app-table {
  min-width: 0;
  table-layout: fixed;
}

.ws-material-consumption-wrap {
  padding: 12px !important;
}

.ws-material-consumption-wrap .app-table thead {
  display: none;
}

.ws-material-consumption-wrap .app-table,
.ws-material-consumption-wrap .app-table tbody,
.ws-material-consumption-wrap .app-table tr,
.ws-material-consumption-wrap .app-table td {
  display: block;
  width: 100%;
}

.ws-material-consumed-row {
  background: transparent !important;
}

.ws-material-consumed-row td {
  padding: 0 0 10px !important;
  border: 0 !important;
}

.ws-material-consumed-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.045);
}

.ws-material-consumed-row.is-muted .ws-material-consumed-card {
  opacity: 0.72;
  background: rgba(248, 250, 252, 0.88);
}

.ws-material-consumed-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ws-material-consumed-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ws-material-consumed-title strong {
  font-size: 0.96rem;
  font-weight: 850;
}

.ws-material-consumed-title small {
  color: var(--app-muted);
  overflow-wrap: anywhere;
}

.ws-material-consumed-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.ws-material-consumed-grid > span {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.9);
}

.ws-material-consumed-grid small {
  display: block;
  color: var(--app-muted);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.ws-material-consumed-grid strong {
  display: block;
  min-width: 0;
  margin-top: 3px;
  color: var(--app-text);
  font-size: 0.86rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.ws-material-lot-stack {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.ws-material-lot-stack em {
  color: var(--app-muted);
  font-style: normal;
}

.ws-material-consumed-actions {
  display: flex;
  justify-content: flex-end;
}

.ws-material-consumed-actions .btn {
  min-height: 34px;
  border-radius: 999px;
}

.ws-material-show-all-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.78);
  line-height: 1;
}

.ws-material-show-all-row .apple-switch {
  flex: 0 0 auto;
}

.ws-material-consumption-cell {
  min-width: 0;
}

.ws-material-consumption-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 7px;
}

.ws-material-consumption-values span {
  min-width: 0;
}

.ws-material-consumption-values small,
.app-stacked-cell small {
  display: block;
  color: var(--app-muted);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.ws-material-consumption-values strong,
.app-stacked-cell strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--app-text);
  font-weight: 800;
}

.ws-material-progress-label {
  display: block;
  margin-top: 3px;
  color: var(--app-muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.ws-material-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ws-material-user-chip > span:last-child {
  min-width: 0;
}

.ws-material-user-chip strong {
  display: block;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-material-user-avatar {
  width: 28px;
  height: 28px;
  font-size: 0.72rem;
}

.ws-material-user-presence .presence-dot {
  width: 9px;
  height: 9px;
  border-width: 1.5px;
}

.app-stacked-cell {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.app-stacked-value {
  display: block;
  min-width: 0;
  color: var(--app-text);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.app-stacked-cell .text-muted {
  color: var(--app-muted) !important;
}

#wsMaterialsPanel .select2-container {
  max-width: 100% !important;
  width: 100% !important;
  min-width: 0 !important;
}

#wsMaterialsPanel .select2-container--open {
  z-index: 1085;
}

#wsMaterialsPanel .select2-dropdown {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
}

#wsMaterialsPanel .select2-selection,
#wsMaterialsPanel .select2-selection__rendered {
  min-width: 0;
}

#wsMaterialsPanel .select2-selection__rendered {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#wsMaterialsPanel .app-table th,
#wsMaterialsPanel .app-table td {
  white-space: normal !important;
  overflow-wrap: anywhere;
}

#wsMaterialsPanel .app-table th:last-child,
#wsMaterialsPanel .app-table td:last-child {
  width: 1%;
  white-space: nowrap !important;
}

#wsMaterialsPanel .ws-material-consumption-wrap .app-table th:last-child,
#wsMaterialsPanel .ws-material-consumption-wrap .app-table td:last-child {
  width: 100%;
  white-space: normal !important;
}

@media (max-width: 991.98px) {
  .ws-material-consumed-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .ws-material-consumed-grid {
    grid-template-columns: 1fr;
  }

  .ws-material-consumed-main {
    align-items: stretch;
    flex-direction: column;
  }

  .ws-material-consumed-actions {
    justify-content: stretch;
  }

  .ws-material-consumed-actions .btn {
    width: 100%;
  }
}

.ws-material-camera-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

.ws-material-camera-video {
  display: block;
  width: 100%;
  max-height: 60vh;
  border-radius: 18px;
  background: #111827;
}

.barcode-profile-grid {
  display: grid;
  gap: 18px;
}

.barcode-profile-card {
  padding: 24px;
}

.barcode-profile-helper {
  display: grid;
  gap: 8px;
  margin: 8px 0 14px;
}

.barcode-profile-helper summary,
.barcode-profile-helper > span {
  color: var(--muted-color, #64748b);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}

.barcode-profile-helper summary::-webkit-details-marker {
  display: none;
}

.barcode-profile-helper summary::after {
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  margin-left: 8px;
  font-size: 0.7rem;
}

.barcode-profile-helper[open] summary::after {
  content: "\f077";
}

.barcode-profile-helper > div,
.barcode-profile-field-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 8px;
}

.barcode-profile-field-chip {
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px !important;
  background: rgba(15, 23, 42, 0.06) !important;
  color: var(--app-muted, #64748b) !important;
  box-shadow: none !important;
  font-size: 0.78rem;
}

.barcode-profile-field-chip:hover {
  background: color-mix(in srgb, var(--app-primary-color, #794bff) 12%, #ffffff) !important;
  color: var(--app-primary-color, #794bff) !important;
}

.barcode-profile-preview {
  max-height: 260px;
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 18px;
}

.barcode-profile-preview .app-table {
  min-width: 420px;
}

.barcode-profile-preview tr.is-warning td {
  background: rgba(239, 68, 68, 0.06);
}

@media (max-width: 1199.98px) {
  .ws-materials-layout {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .ws-material-content {
    overflow: visible;
  }

  .ws-material-tables-card {
    min-height: min(72dvh, 680px);
  }

  .ws-materials-panel {
    height: auto;
    overflow: visible;
  }
}

@media (max-width: 575.98px) {
  .ws-materials-layout {
    gap: 12px;
  }

  .ws-material-scan-actions,
  .ws-material-manual-grid,
  .ws-material-decode-grid {
    grid-template-columns: 1fr;
  }

  .ws-material-scan-card,
  .ws-material-section-card {
    padding: 14px;
    border-radius: 18px;
  }

  .ws-material-tabs-head {
    align-items: stretch;
    flex-direction: column;
  }

  .ws-material-subtabs {
    width: 100%;
    min-width: 0;
  }

  .ws-material-subtabs .nav-link {
    min-height: 40px;
    gap: 6px;
    font-size: 0.78rem;
    padding: 0.38rem 0.35rem;
  }

  .ws-material-show-all-row {
    width: 100%;
    justify-content: flex-start;
  }

  .ws-material-decode-head {
    display: grid;
  }

  .ws-material-match-badge {
    justify-self: start;
  }
}

.app-chat-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1065;
}

.app-chat-fab {
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 22px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--app-primary-color, #111827);
  box-shadow: none;
  font-size: 22px;
  position: relative;
}

.app-chat-fab:hover,
.app-chat-fab:focus {
  background: color-mix(in srgb, var(--app-primary-color, #111827) 88%, white);
  outline: none;
}

.app-chat-count {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 23px;
  height: 23px;
  padding: 0 7px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  border: 2px solid #fff;
}

.app-chat-count[hidden] {
  display: none !important;
}

.app-chat-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: min(420px, calc(100vw - 28px));
  height: min(650px, calc(100vh - 112px));
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform 160ms ease, opacity 160ms ease;
}

.app-chat-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.app-chat-view {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.app-chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(248, 250, 252, 0.9);
}

.app-chat-head strong {
  display: block;
  font-size: 18px;
  color: var(--app-text, #111827);
}

.app-chat-head small {
  display: block;
  color: var(--app-muted, #64748b);
  font-weight: 700;
}

.app-chat-icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 14px;
  margin-left: auto;
}

.app-chat-new {
  margin-left: auto;
  min-height: 36px;
  padding: 0.35rem 0.78rem;
  border-radius: 14px !important;
  white-space: nowrap;
}

.app-chat-new + .app-chat-icon-btn {
  margin-left: 0;
}

.app-chat-search {
  padding: 14px 16px 8px;
}

.app-chat-list,
.app-chat-messages {
  min-height: 0;
  overflow-y: auto;
  padding: 10px 14px 16px;
}

.app-chat-empty {
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 18px 8px;
}

.app-chat-row {
  width: 100%;
  border: 0;
  background: transparent;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-radius: 18px;
  text-align: left;
  color: var(--app-text, #111827);
  cursor: pointer;
}

.app-chat-row:hover,
.app-chat-row:focus,
.app-chat-row.is-selected {
  background: rgba(15, 23, 42, 0.055);
  outline: none;
}

.app-chat-row.is-selected > i {
  color: #0f766e;
}

.app-chat-row strong,
.app-chat-thread-user strong {
  display: block;
  font-size: 15px;
}

.app-chat-row > span:not(.app-chat-row-side) {
  min-width: 0;
}

.app-chat-row small,
.app-chat-thread-user small {
  display: block;
  color: var(--app-muted, #64748b);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-chat-row em {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #ef4444;
  color: #fff;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.app-chat-row-side,
.app-chat-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.app-chat-row-side {
  justify-content: flex-end;
  min-width: 0;
}

.app-chat-row-actions button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.06);
  color: var(--app-muted, #64748b);
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.app-chat-row-actions button:hover,
.app-chat-row-actions button:focus,
.app-chat-row-actions button.is-active {
  background: color-mix(in srgb, var(--app-primary-color, #794bff) 16%, transparent);
  color: #0f766e;
  outline: none;
}

.app-chat-row-actions button:hover {
  transform: translateY(-1px);
}

.app-chat-avatar .app-user-avatar {
  width: 42px;
  height: 42px;
  font-size: 16px;
}

.app-chat-thread-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.app-chat-thread-user > span:not(.app-avatar-presence) {
  min-width: 0;
}

.app-chat-message {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 9px 0;
}

.app-chat-message.is-mine {
  align-items: flex-end;
}

.app-chat-message-line {
  max-width: 88%;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.app-chat-message.is-mine .app-chat-message-line {
  justify-content: flex-end;
}

.app-chat-message-line .app-chat-avatar .app-user-avatar {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.app-chat-message-line .presence-dot {
  width: 9px;
  height: 9px;
  right: -1px;
  bottom: -1px;
}

.app-chat-bubble-wrap {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.app-chat-sender-name {
  padding-left: 6px;
  color: var(--app-muted, #64748b);
  font-size: 0.74rem;
  font-weight: 900;
}

.app-chat-bubble {
  max-width: 82%;
  border-radius: 20px;
  padding: 10px 12px;
  background: #e8eef6;
  color: var(--app-text, #111827);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.app-chat-message-line .app-chat-bubble {
  max-width: 100%;
}

.app-chat-message.is-mine .app-chat-bubble {
  background: var(--app-primary-color, #111827);
  color: #fff;
}

.app-chat-message.is-deleted .app-chat-bubble {
  opacity: 0.72;
  font-style: italic;
}

.app-chat-bubble p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.app-chat-parent {
  width: 100%;
  border: 0;
  text-align: left;
  margin-bottom: 8px;
  padding: 7px 9px;
  border-left: 3px solid rgba(59, 130, 246, 0.75);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.36);
  color: inherit;
  cursor: pointer;
}

.app-chat-parent strong,
.app-chat-parent span {
  display: block;
  font-size: 12px;
}

.app-chat-message-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 6px;
  font-size: 11px;
  opacity: 0.72;
}

.app-chat-read-receipt {
  cursor: help;
}

.app-chat-unread-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.app-chat-unread-divider::before,
.app-chat-unread-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: color-mix(in srgb, var(--app-primary-color, #794bff) 32%, transparent);
}

.app-chat-unread-divider span {
  padding: 4px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--app-primary-color, #794bff) 12%, transparent);
}

.app-chat-message-actions {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.app-chat-message-actions button {
  border: 0;
  width: 29px;
  height: 29px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #64748b;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.app-chat-message-actions button.active {
  color: #ef4444;
}

.app-chat-message.is-highlighted .app-chat-bubble {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-primary-color, #794bff) 28%, transparent), 0 14px 30px rgba(15, 23, 42, 0.12);
}

.app-chat-message-files {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.app-chat-media-thumb,
.app-chat-file {
  border: 0;
  cursor: pointer;
  text-align: left;
}

.app-chat-message-files img,
.app-chat-message-files video {
  max-width: min(220px, 100%);
  border-radius: 16px;
  display: block;
}

.app-chat-file,
.app-chat-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.92);
  color: var(--app-text, #111827);
  text-decoration: none !important;
  font-weight: 800;
}

.app-chat-file span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-chat-shared-card {
  width: 100%;
  margin-top: 8px;
  border: 1px solid color-mix(in srgb, var(--app-primary-color, #794bff) 22%, transparent);
  border-radius: 16px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  text-align: left;
  background: color-mix(in srgb, var(--app-primary-color, #794bff) 10%, transparent);
  color: inherit;
  cursor: pointer;
}

.app-chat-shared-card span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 900;
  color: #0f766e;
}

.app-chat-shared-card strong,
.app-chat-shared-card small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-chat-shared-card small {
  color: var(--app-muted, #64748b);
}

.app-chat-message.is-mine .app-chat-shared-card {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.28);
}

.app-chat-message.is-mine .app-chat-shared-card span,
.app-chat-message.is-mine .app-chat-shared-card small {
  color: rgba(255, 255, 255, 0.82);
}

.app-chat-reply,
.app-chat-attachments {
  padding: 0 14px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.app-chat-reply span,
.app-chat-attachment-chip {
  min-width: 0;
  max-width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  padding: 8px 10px;
  background: rgba(248, 250, 252, 0.92);
}

.app-chat-reply button,
.app-chat-attachment-chip button {
  border: 0;
  background: transparent;
  color: #64748b;
}

.app-chat-picker-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 2px 10px;
}

.app-chat-picker-tools button {
  min-height: 38px;
  border: 0;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--app-muted, #64748b);
  font-weight: 900;
}

.app-chat-picker-tools button.active {
  background: #111827;
  color: #fff;
}

.app-chat-group-builder {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.82);
}

.app-chat-group-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.app-chat-group-selected span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--app-primary-color, #794bff) 12%, transparent);
  color: #0f766e;
  font-size: 0.82rem;
  font-weight: 900;
}

.app-chat-group-selected button {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.1);
  color: inherit;
}

.app-chat-share-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  align-items: center;
  margin-bottom: 10px;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--app-primary-color, #794bff) 22%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--app-primary-color, #794bff) 10%, transparent);
}

.app-chat-share-notice span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0f766e;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.app-chat-share-notice strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-chat-share-notice button {
  grid-row: 1 / span 2;
  grid-column: 2;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.08);
  color: var(--app-muted, #64748b);
}

.app-file-preview-modal .modal-content {
  border: 0;
  border-radius: 24px;
  overflow: hidden;
}

.app-file-preview-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  margin-right: 12px;
}

.app-file-preview-modal .modal-body {
  min-height: 62vh;
  max-height: 78vh;
  overflow: auto;
  background: #0f172a;
}

.app-file-preview-stage {
  min-height: 62vh;
  display: grid;
  place-items: center;
}

.app-file-preview-stage img,
.app-file-preview-stage video {
  max-width: 100%;
  max-height: 72vh;
  transform-origin: center center;
  transition: transform 0.16s ease;
}

.app-file-preview-stage.document {
  place-items: stretch;
  background: #111827;
}

.app-file-preview-stage iframe {
  width: 100%;
  min-height: 72vh;
  border: 0;
  border-radius: 14px;
  background: #fff;
  transform-origin: top center;
  transition: transform 0.16s ease;
}

.app-shared-post-modal .modal-content {
  border: 0;
  border-radius: 24px;
  overflow: hidden;
}

.app-shared-post-modal .modal-dialog {
  width: min(760px, calc(100vw - 24px));
}

.app-shared-post-modal .modal-body {
  max-height: min(76vh, 760px);
  overflow: auto;
}

.modal.app-shared-post-modal,
.modal.ws-feed-modal,
.modal.app-file-preview-modal {
  z-index: 1095;
}

.app-shared-post-card {
  display: grid;
  gap: 12px;
  margin: 0;
}

.app-shared-post-actions {
  justify-content: flex-start;
}

.app-shared-post-comments {
  max-height: 34vh;
  overflow: auto;
  padding-right: 2px;
}

.app-shared-post-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--app-muted, #64748b);
}

.app-shared-post-card h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 900;
}

.app-chat-compose {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.app-chat-compose textarea {
  resize: none;
  min-height: 42px;
  max-height: 110px;
}

.app-chat-send {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 15px;
}

@media (max-width: 575.98px) {
  .app-shared-post-modal .modal-dialog {
    margin: 8px auto;
    width: calc(100vw - 16px);
  }

  .app-shared-post-modal .modal-body {
    max-height: calc(100vh - 126px);
    padding: 14px;
  }

  .app-shared-post-card {
    padding: 13px;
    border-radius: 20px;
  }

  .app-shared-post-card .ws-feed-post-header {
    align-items: flex-start;
  }

  .app-shared-post-card .ws-feed-author {
    max-width: 100%;
  }

  .app-shared-post-card .ws-feed-media-grid {
    grid-template-columns: 1fr;
  }

  .app-shared-post-card .ws-feed-comment {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .app-shared-post-card .ws-feed-comment .ws-feed-avatar,
  .app-shared-post-card .ws-feed-comment .ws-feed-avatar-presence .ws-feed-avatar {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .app-chat-widget {
    right: 14px;
    bottom: 14px;
  }

  .app-chat-panel {
    width: calc(100vw - 20px);
    height: min(620px, calc(100vh - 92px));
    right: -4px;
    border-radius: 22px;
  }

  .app-chat-bubble {
    max-width: 90%;
  }

  .app-chat-head {
    padding: 13px 14px;
  }

  .app-chat-thread-user strong {
    font-size: 14px;
  }

  .app-chat-thread-user small {
    max-width: 180px;
  }
}

/* Workstation feed */
body.ws-workstation-page .ws-feed-panel {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  overflow: hidden;
}

body.ws-workstation-page #feedTab .tab-scroll-area {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body.ws-workstation-page .ws-feed-composer-card,
body.ws-workstation-page .ws-feed-stream-card,
.profile-feed-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--app-border);
  border-radius: 24px;
  background: var(--app-container-bg, rgba(255, 255, 255, 0.9));
  box-shadow: var(--app-shadow-soft);
}

body.ws-workstation-page .ws-feed-composer-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.ws-workstation-page .ws-feed-composer {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

body.ws-workstation-page .ws-feed-stream-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.ws-workstation-page .ws-feed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

body.ws-workstation-page .ws-feed-search-wrap {
  width: min(560px, 100%);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}

body.ws-workstation-page .ws-feed-search-wrap .form-control {
  flex: 1 1 320px;
  min-width: 0;
}

body.ws-workstation-page .ws-feed-search-wrap .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

body.ws-workstation-page .ws-feed-list,
.profile-feed-list {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
  padding-right: 4px;
}

body.ws-workstation-page .ws-feed-list {
  flex: 1 1 auto;
}

.ws-feed-post {
  padding: 16px;
  border: 1px solid var(--app-border);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.ws-feed-post.is-pinned {
  border-color: color-mix(in srgb, var(--app-primary-color, #794bff) 28%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--app-primary-color, #794bff) 12%, transparent), #fff 58%);
}

.ws-feed-post.is-focused {
  border-color: rgba(0, 123, 255, 0.42);
  box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.12), 0 12px 28px rgba(15, 23, 42, 0.06);
}

.ws-feed-post-header,
.ws-feed-post-actions,
.ws-feed-context,
.ws-feed-mention-chips,
.ws-feed-media-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ws-feed-post-header {
  justify-content: space-between;
}

.ws-feed-post-badges {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.ws-feed-visibility-badge {
  gap: 6px;
  color: #0f766e;
  background: color-mix(in srgb, var(--app-primary-color, #794bff) 14%, transparent);
}

.ws-feed-author {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(100%, 360px);
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--app-text);
  text-align: left;
  padding: 4px 10px 4px 4px;
  line-height: 1.18;
  overflow: hidden;
}

.ws-feed-author:hover,
.ws-feed-author:focus {
  border-color: rgba(0, 123, 255, 0.18);
  background: rgba(0, 123, 255, 0.07);
  outline: none;
}

.ws-feed-author span {
  min-width: 0;
  display: grid;
}

.ws-feed-author small,
.ws-feed-context,
.ws-feed-post-body {
  color: var(--app-muted);
}

.ws-feed-author small {
  line-height: 1.25;
}

.ws-feed-avatar {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  border-radius: 50%;
  color: #fff;
  background: var(--primary-color);
  font-weight: 900;
  object-fit: cover;
}

.ws-feed-avatar-presence {
  flex: 0 0 auto;
}

.ws-feed-avatar-presence .ws-feed-avatar,
.ws-feed-avatar {
  background: #111827;
}

.ws-feed-avatar-presence .presence-dot {
  right: -1px;
  bottom: 1px;
  width: 12px;
  height: 12px;
}

.ws-feed-post-title {
  margin: 14px 0 6px;
  font-size: 1.12rem;
  font-weight: 900;
}

.ws-feed-post-body {
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.feed-mention-link {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border: 1px solid rgba(0, 123, 255, 0.2);
  border-radius: 999px;
  padding: 1px 7px 2px;
  color: #0757c8;
  background: rgba(0, 123, 255, 0.08);
  font-weight: 900;
  line-height: 1.35;
  vertical-align: baseline;
  cursor: pointer;
}

.feed-mention-link:hover,
.feed-mention-link:focus {
  border-color: rgba(0, 123, 255, 0.36);
  background: rgba(0, 123, 255, 0.14);
  color: #043f97;
  outline: none;
}

.ws-feed-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.ws-feed-media-grid img,
.ws-feed-media-grid video {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  object-fit: cover;
  background: #eef2f7;
}

.ws-feed-media-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  overflow: hidden;
  cursor: zoom-in;
}

.ws-feed-document-chip {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.92);
  color: var(--app-text);
  text-decoration: none !important;
  font-weight: 800;
}

.ws-feed-document-chip i {
  color: var(--app-primary);
}

.ws-feed-document-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-feed-media-modal .modal-body {
  min-height: 55vh;
  display: grid;
  place-items: center;
  overflow: auto;
  background: #0f172a;
}

.ws-feed-media-modal img {
  max-width: 100%;
  max-height: 75vh;
  transform-origin: center center;
  transition: transform 0.18s ease;
}

.ws-feed-media-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  margin-right: 12px;
}

.ws-feed-context {
  margin-top: 12px;
  font-size: 0.86rem;
}

.ws-feed-context span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ws-feed-post-actions {
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.ws-feed-post.is-deleted {
  background: rgba(248, 250, 252, 0.84);
  border-style: dashed;
}

.ws-feed-deleted-state,
.ws-feed-deleted-inline,
.ws-feed-edited-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--app-muted);
}

.ws-feed-deleted-state {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(148, 163, 184, 0.12);
  font-weight: 800;
}

.ws-feed-edited-label {
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 800;
}

.ws-feed-action-spacer {
  flex: 1 1 auto;
}

.ws-feed-action-btn {
  min-width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  color: #111827;
  background: rgba(15, 23, 42, 0.055);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.ws-feed-action-btn:hover,
.ws-feed-action-btn:focus {
  background: rgba(15, 23, 42, 0.1);
  outline: none;
  transform: translateY(-1px);
}

.ws-feed-action-btn.xs {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  font-size: 0.78rem;
}

.ws-feed-action-btn.is-liked {
  color: #e11d48;
  background: rgba(225, 29, 72, 0.1);
}

.ws-feed-action-btn.has-likes {
  color: #111827;
}

.ws-feed-action-btn.danger {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.1);
}

.ws-feed-pin-btn {
  width: 34px;
  min-width: 34px;
  padding-inline: 0;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: #fff;
  color: rgba(15, 23, 42, 0.58);
}

.ws-feed-pin-btn.is-pinned,
.ws-feed-pinned-indicator {
  color: #111827;
  background: rgba(15, 23, 42, 0.08);
}

.ws-feed-pin-btn.is-pinned .fa-thumbtack,
.ws-feed-pinned-indicator .fa-thumbtack,
.app-chat-row-actions button.is-active[data-chat-conversation-action="pin"] .fa-thumbtack,
.app-chat-list-actions button.is-active [data-chat-conversation-action="pin"] .fa-thumbtack,
.app-chat-list-actions button.is-active .fa-thumbtack {
  transform: rotate(45deg);
}

.app-chat-list-actions button.is-active,
.app-chat-list-actions button.is-active:hover {
  color: #111827;
  background: rgba(15, 23, 42, 0.08);
}

.ws-feed-pinned-indicator {
  min-width: 28px;
  padding-inline: 8px;
}

.ws-feed-unread-badge {
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ffd66b;
  color: #7a4b00;
  font-size: 0.72rem;
  font-weight: 900;
}

.ws-feed-separator {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 2px;
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ws-feed-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(148, 163, 184, 0.25);
}

.ws-feed-separator.is-new {
  color: #7a4b00;
}

.ws-feed-comments {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.ws-feed-comments-toggle {
  width: fit-content;
}

.ws-feed-comment,
.ws-feed-comment-form {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.ws-feed-comment.is-reply {
  margin-left: calc(28px * var(--reply-depth, 1));
  padding-left: 10px;
  border-left: 2px solid rgba(148, 163, 184, 0.26);
}

.ws-feed-comment .ws-feed-avatar,
.ws-feed-comment-form .ws-feed-avatar {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  font-size: 0.78rem;
}

.ws-feed-comment-body {
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.92);
}

.ws-feed-comment-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.ws-feed-comment-head small,
.ws-feed-comment-actions {
  color: var(--app-muted);
}

.ws-feed-comment-actions,
.ws-feed-comment-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 6px;
}

.ws-feed-comment-actions .btn-xs {
  min-height: 28px;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
}

.ws-feed-comment-actions .is-liked {
  color: #e11d48;
  background: rgba(225, 29, 72, 0.1);
}

.ws-feed-like-btn,
.ws-feed-comment-actions .btn-xs {
  position: relative;
  overflow: visible;
}

.ws-feed-like-popover {
  position: absolute;
  z-index: 3000;
  left: 50%;
  bottom: calc(100% + 8px);
  min-width: 170px;
  max-width: 260px;
  display: none;
  transform: translateX(-50%);
  padding: 8px 10px;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  color: var(--app-text);
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
  text-align: left;
  font-weight: 800;
}

.ws-feed-like-popover-data {
  display: none !important;
}

.ws-feed-like-popover-portal {
  position: fixed;
  z-index: 2147483000;
  min-width: 180px;
  max-width: 280px;
  padding: 9px 11px;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  color: var(--app-text);
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.2);
  text-align: left;
  font-weight: 800;
  pointer-events: auto;
}

.ws-feed-like-popover-portal .ws-feed-like-user {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 3px 0;
}

.ws-feed-like-popover-portal .ws-feed-avatar {
  width: 26px;
  height: 26px;
  flex-basis: 26px;
  font-size: 0.7rem;
}

.ws-feed-like-popover-portal .presence-dot {
  width: 8px;
  height: 8px;
}

.ws-feed-like-popover-portal strong {
  min-width: 0;
  overflow: hidden;
  color: var(--app-text);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-feed-post,
.ws-feed-post-actions,
.ws-feed-comments,
.ws-feed-comment,
.ws-feed-comment-actions {
  overflow: visible;
}

.ws-feed-like-popover span {
  display: block;
  white-space: nowrap;
}

.ws-feed-like-btn:hover .ws-feed-like-popover,
.ws-feed-like-btn:focus .ws-feed-like-popover,
.ws-feed-comment-actions .btn-xs:hover .ws-feed-like-popover,
.ws-feed-comment-actions .btn-xs:focus .ws-feed-like-popover {
  display: block;
}

.ws-feed-reply-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin-bottom: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.ws-feed-reply-chip button {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0 !important;
  border-radius: 50% !important;
  box-shadow: none;
  color: inherit;
  background: rgba(15, 23, 42, 0.08);
}

.ws-feed-comment-form .ws-feed-mention-wrap {
  min-width: 0;
}

.ws-feed-comment-form .form-control {
  min-height: 38px;
  resize: vertical;
}

.ws-feed-mention-wrap {
  position: relative;
}

.ws-feed-mention-menu {
  position: absolute;
  z-index: 1040;
  left: 0;
  right: 0;
  top: calc(100% - 4px);
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--app-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
}

.ws-feed-mention-menu button {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
}

.ws-feed-mention-result-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #0757c8;
  background: rgba(0, 123, 255, 0.09);
  font-size: 0.68rem;
  font-weight: 900;
}

.ws-feed-mention-menu button:hover {
  background: rgba(15, 23, 42, 0.06);
}

.ws-feed-mention-menu small {
  color: var(--app-muted);
}

.ws-feed-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--app-border);
}

.ws-feed-detail-grid {
  display: grid;
  gap: 2px;
}

.ws-feed-entity-detail {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--app-border);
  border-radius: 20px;
  background: rgba(248, 250, 252, 0.9);
}

.ws-feed-entity-icon {
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  color: #fff;
  background: #111827;
  font-size: 1.2rem;
}

.ws-feed-entity-icon.event {
  background: #0891b2;
}

.ws-feed-entity-icon.task {
  background: #4f46e5;
}

.ws-feed-entity-icon.asset {
  background: #0f766e;
}

.ws-feed-entity-detail h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 900;
}

.ws-feed-entity-detail p {
  margin: 3px 0 8px;
  color: var(--app-muted);
}

.ws-feed-entity-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ws-feed-detail-row span {
  color: var(--app-muted);
}

.ws-feed-detail-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.ws-feed-quick-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--app-border);
}

.ws-feed-modal .modal-dialog-scrollable .modal-body {
  overflow: auto;
}

.ws-feed-task-shortcut .ws-task-card {
  max-width: none;
  margin: 0;
  box-shadow: none;
}

.ws-feed-task-shortcut .ws-task-card-header {
  align-items: flex-start;
}

.ws-feed-user-detail {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--app-border);
  border-radius: 20px;
  background: rgba(248, 250, 252, 0.9);
}

.ws-feed-user-detail .ws-feed-avatar {
  width: 54px;
  height: 54px;
  flex-basis: 54px;
  font-size: 1.1rem;
}

.ws-feed-user-detail h3 {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 900;
}

.ws-feed-user-detail p {
  margin: 2px 0 8px;
  color: var(--app-muted);
}

.ws-feed-user-mini-feed {
  max-height: 48vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 1199.98px) {
  body.ws-workstation-page .ws-feed-panel {
    grid-template-columns: 1fr;
    overflow: auto;
  }
}

@media (max-width: 767.98px) {
  body.ws-workstation-page .ws-feed-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  body.ws-workstation-page .ws-feed-search-wrap {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  body.ws-workstation-page .ws-feed-composer-card,
  body.ws-workstation-page .ws-feed-stream-card,
  .profile-feed-card {
    padding: 14px;
    border-radius: 20px;
  }
}

.input-group-text {
  margin-left: 5px;
  border: none!important;
  border-top-right-radius: 18px!important;
  border-bottom-right-radius: 18px!important;
  box-shadow: 2px 4px 12px rgba(0,0,0,.08);
}

.card {
  border: none;
  border-radius: 18px;
  white-space: normal;
  box-shadow: 2px 4px 12px rgba(0,0,0,.08);
  /*transition: all .3s cubic-bezier(0,0,.5,1);*/
  z-index: 2;
  min-height: 100%;
}

.card-category {
  border-radius: 18px;
  background: lightcoral;
  color: white;
}

.card:hover {
  /*transform: scale(1.02);*/ /* Zoom in effect on hover */
  z-index: 1;
}

.card-header:first-child {
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
}
.card-header {
  border-bottom: 0.1px solid rgba(0,0,0,.125);
  background-color: transparent;
}

.card-footer {
  border-bottom-left-radius: 18px!important;
  border-bottom-right-radius: 18px!important;
}

#lineChart, #doughnutChart, #barChart {
  background: white;
  box-shadow: rgba(0, 0, 0, 0.08) 2px 4px 12px;
  padding: 10px;
  border: none !important;
  border-radius: 18px !important;
}

.card-body {
  padding: 1rem!important;
}

#colProductCard > .card {
  zoom: 70%;
  margin-bottom: 10px;
  transform: translateX(-100%);
  transition: transform 0.35s, opacity 1s;
  opacity: 0;
}

/* #colProductCard {
  height: fit-content;
} */

.afterLoad {
	opacity: 1!important;
	transform: translateX(0%)!important;
}

#colCategoryCard {
  margin-bottom: 10px;
}

#colCategoryCard > div > div > h6 {
  text-align: center!important;
  margin: 0;
}

.card.clicked {
    background-color: lightcoral;
    /*border: 2px solid red;*/
    color: white;
    animation: bounce 0.5s;
}

.dropdown-menu {
  border: none;
  border-radius: 18px;
}

.dropdown-menu > button {
  box-shadow: none;

}

.border-rounded {
  border-radius: 18px!important;
}
/* TABLE CSS OLD */
/*
table {
  border: none!important;
  border-radius: 18px!important;
  box-shadow: 2px 4px 12px rgba(0,0,0,.08);
  background: white;
}
thead {
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  background-color:  var(--secondary-color);
  color: white;
}
tbody {
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
}

.table-bordered {
  border: 0;
}
th {
  border: 0 !important;
}
th:first-child {
  border-top-left-radius: 18px !important;
}
th:last-child {
  border-top-right-radius: 18px !important;
}

.table td {
  border: 0 !important;
}
*/

/*** TBALE CSS NEW ***/
/****************************************************
  TABLE (GLOBAL STYLE) + SCROLLABLE #tableView
  Works on pages where you already have:
    <div class="table-responsive" id="tableView">
      <table class="table ...">...</table>
    </div>
****************************************************/

table {
  border: none !important;
  border-radius: 18px !important;
  box-shadow: 2px 4px 12px rgba(0,0,0,.08);
  background: white;
}

thead {
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  background-color: var(--secondary-color);
  color: white;
}

tbody {
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
}

.table-bordered {
  border: 0;
}

th {
  border: 0 !important;
}

th:first-child {
  border-top-left-radius: 18px !important;
}

th:last-child {
  border-top-right-radius: 18px !important;
}

.table td {
  border: 0 !important;
}

.table th {
  white-space: nowrap; /* Prevent text wrapping in table headers */
}

/* Define media query for mobile view */
@media (max-width: 576px) {
  .table th, .table td {
    font-size: 14px; /* Reduce font size for mobile view */
  }
}

/* =========================================================
   SCROLLABLE TABLE VIEW (GLOBAL – JS DRIVEN)
   Target: div.table-responsive#tableView
========================================================= */

.table-responsive#tableView {
  box-shadow: 2px 4px 12px rgba(0, 0, 0, .08);
  overflow-y: auto !important;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 18px;
  background: white;

  /* ONLY bottom gap – height is calculated by JS */
  --tableViewBottomGap: 14px;

  /* fallback if JS is not loaded yet */
  max-height: calc(100dvh - 340px);
}

/* Keep table snug inside scroll container */
.table-responsive#tableView > table {
  margin-bottom: 0 !important;
}

/* Sticky header */
.table-responsive#tableView thead th {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: transparent;
  color: #475569;
  white-space: nowrap;
}

/* Mobile tweak: just reduce fallback (JS still wins) */
@media (max-width: 576px) {
  .table-responsive#tableView {
    max-height: calc(100dvh - 380px);
  }
}

.modal-content {
  border: none!important;
  border-radius: 18px!important;
  box-shadow: 2px 4px 12px rgba(0,0,0,.08);
}

.app-confirm-modal .modal-content {
  border-radius: 24px !important;
}

.app-confirm-modal .modal-body {
  padding: 24px;
}

.app-confirm-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: flex-start;
}

.app-confirm-icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  font-size: 1.1rem;
}

.app-confirm-icon.is-neutral {
  color: #2563eb;
  background: rgba(37, 99, 235, .1);
}

.app-confirm-icon.is-danger {
  color: #dc2626;
  background: rgba(220, 38, 38, .1);
}

.app-confirm-title {
  margin: 0 0 6px;
  color: #0f172a;
  font-size: 1.12rem;
  font-weight: 900;
}

.app-confirm-message {
  margin: 0;
  color: #64748b;
  font-size: .95rem;
  line-height: 1.45;
}

.app-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

@media (max-width: 575.98px) {
  .app-confirm-actions {
    flex-direction: column-reverse;
  }

  .app-confirm-actions .btn {
    width: 100%;
  }
}

.nav-pills .nav-link.active, .nav-pills .show>.nav-link {
  background-color: var(--secondary-color)!important;  
}

/* MOBILE STYLE ONLY - START */
@media only screen and (max-width: 767px) {
  #colCategoryCard {
    padding: 0px 5px 0px 5px;
  }
  
  #card-text-mobile {
    text-align: center!important;
    font-size: 12px!important;
    font-weight: bold;
  }
  #card-body-mobile {
    padding: 0.7rem 0.3rem 0.7rem 0.3rem!important;
  }
  .xx-small {
    font-size: xx-small;
    width: 100%;
  }
  .break-word {
    width: 100%;
    white-space: initial;
    word-wrap: break-word;
  }
}
/* MOBILE STYLE ONLY - END */

/* fade in animation */
.fade-in {
  animation: fadeInAnimation 0.8s ease-in-out;
}

@keyframes fadeInAnimation {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.orderBtn {
  position:fixed;
  right:    10px;
  bottom:   10px;
}

.highlighted-card {
  background-color: lightcoral;
  /*border: 2px solid red;*/
  color: white;
}

.highlighted-row-grey {
  background-color: lightgrey;
}
.highlighted-row-red {
  background-color: lightcoral;
  color: white;
  font-weight: bold;
}

.disabled-card {
  background-color: lightgrey;
}

.btn-md {
  font-weight: bold;
  border-radius: 5px;
  width: 5vh;
  font-size: 20px;
}

.nav-link.active {
  font-weight: bold;
}
/*
.badge-secondary {
    color: #fff;
    background-color: lightcoral;
}
    */
.badge-primary {
  color: #fff;
  background-color: var(--success-color);
}

/* iOS checkbox style */
input.apple-switch {
  position: relative;
  appearance: none; outline: none;
  width: 50px; height: 30px;
  background-color: #ffffff; border: 1px solid #D9DADC;
  border-radius: 50px; box-shadow: inset -20px 0 0 0 #ffffff;
  transition-duration: 200ms;
  }
  input.apple-switch:after {
  content: "";
  position: absolute;
  top: 1px; left: 1px;
  width: 26px; height: 26px;
  background-color: transparent;
  border-radius: 50%; box-shadow: 2px 4px 6px rgba(0,0,0,0.2);
  }
  input.apple-switch:checked {
  border-color: var(--app-primary-color, #111827);
  box-shadow: inset 20px 0 0 0 var(--app-primary-color, #111827);
  }
  input.apple-switch:checked:after {
  left: 20px;
  box-shadow: -2px 4px 3px rgba(0,0,0,0.05);
  }

/* Large table checkboxes */
.dt-big-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #0a84ff;
  transform: scale(1.15);
}

/* opzionale: un po' più allineate */
#dtTableView td,
#dtTableView th {
  vertical-align: middle;
}

/* Global flash messages */
.app-flash-container {
  position: fixed;
  top: calc(var(--app-topbar-h, 72px) + 12px);
  left: calc(var(--app-sidebar-w, 280px) + var(--app-shell-pad-x, 24px));
  right: var(--app-shell-pad-x, 24px);
  z-index: 2200;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

body.app-sidebar-collapsed .app-flash-container {
  left: calc(var(--app-sidebar-collapsed-w, 84px) + var(--app-shell-pad-x, 24px));
}

body:not(.has-app-sidebar) .app-flash-container {
  top: 18px;
  left: 18px;
  right: 18px;
}

.app-flash-banner {
  width: min(780px, 100%);
  min-height: 54px;
  padding: 13px 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  transform: translateY(0);
  opacity: 1;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-flash-banner.is-hiding {
  opacity: 0;
  transform: translateY(-8px);
}

.app-flash-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.app-flash-text {
  flex: 1 1 auto;
  color: var(--app-text, var(--text-color));
  font-weight: 700;
  line-height: 1.35;
}

.app-flash-close {
  border: 0;
  background: transparent;
  color: var(--app-muted, var(--muted-color));
  width: 34px;
  height: 34px;
  border-radius: 999px;
  cursor: pointer;
}

.app-flash-close:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--app-text, var(--text-color));
}

.app-flash-success .app-flash-icon {
  background: rgba(34, 197, 94, 0.14);
  color: #16a34a;
}

.app-flash-warning .app-flash-icon {
  background: rgba(245, 158, 11, 0.16);
  color: #d97706;
}

.app-flash-danger .app-flash-icon {
  background: rgba(239, 68, 68, 0.14);
  color: #dc2626;
}

.app-flash-info .app-flash-icon {
  background: rgba(10, 132, 255, 0.12);
  color: var(--app-primary, var(--primary-color));
}

@media (max-width: 991.98px) {
  .app-flash-container {
    top: calc(var(--app-topbar-h, 64px) + 10px);
    left: 14px;
    right: 14px;
  }
}

/* Legacy message page */
.alert {
  width: 80%;
  margin: 20px auto;
  padding: 20px;
  position: relative;
  border-radius: 5px;
  /*box-shadow: 0 0 15px 5px #ccc;*/
}

.close {
  position: absolute;
  width: 30px;
  height: 30px;
  opacity: 0.5;
  border-width: 1px;
  border-style: solid;
  border-radius: 50%;
  right: 15px;
  top: 25px;
  text-align: center;
  font-size: 1.6em;
  cursor: pointer;
}

.simple-alert {
  background-color: #ebebeb;
  border-left: 5px solid #bdbdbd;
}

.simple-alert .close {
  border-color: #bdbdbd;
  color: #bdbdbd;
}

.success-alert {
  background-color: #a8f0c6;
  border-left: 5px solid #4d9d5f;
}

.success-alert .close {
  border-color: #4d9d5f;
  color: #4d9d5f;
}

.danger-alert {
  background-color: #f7a7a3;
  border-left: 5px solid #d9534f;
}

.danger-alert .close {
  border-color: #d9534f;
  color: #d9534f;
}

.warning-alert {
  background-color: #ffd48a;
  border-left: 5px solid #e08e17;
}

.warning-alert .close {
  border-color: #e08e17;
  color: #e08e17;
}

.modal .modal-header .close {
  position: static;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: -6px -6px -6px auto;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--app-text);
  opacity: 1;
  font-size: 1.25rem;
  line-height: 1;
  text-shadow: none;
}

.modal .modal-header .close span {
  display: block;
  line-height: 1;
  transform: translateY(-1px);
}

.modal .modal-header .close:hover,
.modal .modal-header .close:focus {
  background: rgba(15, 23, 42, 0.1);
  color: var(--app-text);
  outline: none;
}

.options-panel {
  transition: max-height 0.3s ease-in-out;
  overflow: hidden;
  max-height: 0;
}

.options-panel.show-panel {
  max-height: 1000px;
}

/* CSS for the popup */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--primary-color);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
    width: 80%;
}

.table th {
  white-space: nowrap; /* Prevent text wrapping in table headers */
}

/* Define media query for mobile view */
@media (max-width: 576px) {
  .table th, .table td {
    font-size: 14px; /* Reduce font size for mobile view */
  }
}


/* input error animation */
/*
@keyframes bounce {
  0% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}
*/

.input-error {
  animation: bounce 0.25s;
  border: #f5c2c7 2px solid;
}

#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(245, 246, 248, 0.08);
  backdrop-filter: blur(7px) saturate(135%);
  -webkit-backdrop-filter: blur(7px) saturate(135%);
  z-index: 9999;
  display: none;
  pointer-events: auto;
}

#loading-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}

#loading-icon::after {
  content: '';
  position: absolute;
  inset: 14px;
  border-radius: 999px;
  border: 3px solid rgba(15, 23, 42, 0.12);
  border-top-color: var(--primary-color);
  animation: app-spin 0.75s linear infinite;
}

@keyframes app-spin {
  to {
    transform: rotate(360deg);
  }
}

/* checkbox input like iOS */
.iosCheckbox {
  /* remove browser chrome */
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  outline: none;
  /*add styling */
  position: relative;
  width: 2rem;
  height: 2rem;
  border: 2px solid #455A64;
  overflow: hidden;
  border-radius: 3px;
  box-shadow: inset 0 0 4px 0 rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

.iosCheckbox::before {
  content: '';
  color: #fff;
  position: absolute;
  top: 4px;
  right: 4px;
  bottom: 4px;
  left: 4px;
  background-color: transparent;
  background-size: contain;
  background-position: center center;
  background-repeat: no-repeat;
  border-radius: 2px;
  -webkit-transform: scale(0);
          transform: scale(0);
  -webkit-transition: -webkit-transform 0.25s ease-in-out;
  transition: -webkit-transform 0.25s ease-in-out;
  transition: transform 0.25s ease-in-out;
  transition: transform 0.25s ease-in-out, -webkit-transform 0.25s ease-in-out;
  /* base64 encoded to make things easier to show 
  	normally you would use an image or a font
  */
  background-image: url("data:image/svg+xml;base64,PCEtLSBHZW5lcmF0ZWQgYnkgSWNvTW9vbi5pbyAtLT4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjQ0OCIgaGVpZ2h0PSI0NDgiIHZpZXdCb3g9IjAgMCA0NDggNDQ4Ij4KPHRpdGxlPjwvdGl0bGU+CjxnIGlkPSJpY29tb29uLWlnbm9yZSI+CjwvZz4KPHBhdGggZD0iTTQxNy43NSAxNDEuNWMwIDYuMjUtMi41IDEyLjUtNyAxN2wtMjE1IDIxNWMtNC41IDQuNS0xMC43NSA3LTE3IDdzLTEyLjUtMi41LTE3LTdsLTEyNC41LTEyNC41Yy00LjUtNC41LTctMTAuNzUtNy0xN3MyLjUtMTIuNSA3LTE3bDM0LTM0YzQuNS00LjUgMTAuNzUtNyAxNy03czEyLjUgMi41IDE3IDdsNzMuNSA3My43NSAxNjQtMTY0LjI1YzQuNS00LjUgMTAuNzUtNyAxNy03czEyLjUgMi41IDE3IDdsMzQgMzRjNC41IDQuNSA3IDEwLjc1IDcgMTd6Ij48L3BhdGg+Cjwvc3ZnPgo=");
}

.iosCheckbox:checked::before {
  -webkit-transform: scale(1);
          transform: scale(1);
}

/** Daily Menu header style **/
.main{
  width:100%;  
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
}
.h1{
  font-weight: bolder;
  text-align:center;
  text-transform: uppercase;
  color: white; 
  font-size: 4rem;
}

.roller{
  height: 4.125rem;
  line-height: 4rem;
  position: relative;
  overflow: hidden; 
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
}


#spare-time{
  font-size: 1rem;
  font-style: italic;
  letter-spacing: 1rem;
  margin-top: 0;
  color: white;
  
}

.roller #rolltext {
  position: absolute;
  top: 0;
  animation: slide 10s infinite;  
}

@keyframes slide {
  0%{
    top:0;
  }
  25%{
    top: -4rem;    
  }
  50%{
    top: -8rem;
  }
  72.5%{
    top: -12.25rem;
  }
}

@media screen and (max-width: 600px){
  .h1{
  font-weight: bolder;
  text-align:center;
  text-transform: uppercase;
  color: white; 
  font-size: 2.125rem;
}
  
  .roller{
  height: 2.6rem; 
  line-height: 2.125rem;  
  }
  
  #spare-time {
    font-size: 1rem;
    letter-spacing: 0.1rem;
  }
  
  .roller #rolltext {  
  animation: slide-mob 5s infinite;  
}
  
  @keyframes slide-mob {
  0%{
    top:0;
  }
  25%{
    top: -2.125rem;    
  }
  50%{
    top: -4.25rem;
  }
  72.5%{
    top: -6.375rem;
  }
}
}

.bg {
  display: none;
  animation: none;
  background-image: none;
  bottom:0;
  left:-50%;
  opacity:.5;
  position:fixed;
  right:-50%;
  top:0;
  z-index:-1;
}

.bg2 {
  animation-direction:alternate-reverse;
  animation-duration:4s;
}

.bg3 {
  animation-duration:5s;
}

@keyframes slide-bg {
  0% {
    transform:translateX(-25%);
  }
  100% {
    transform:translateX(25%);
  }
}

#container-flip-text {
  color: white;
  text-transform: uppercase;
  font-size: 30px;
  font-weight:bold;
  width:100%;
  bottom:45%;
  display:block;
  text-align: center;
  margin-bottom: 20px;
}

#flip {
  height:70px;
  overflow:hidden;
}

#flip > div {
  height: 100px;  
}

#flip > div > div {
  color:#fff;
  padding:4px 12px;
  height:50px;
  margin-bottom:45px;
  display:inline-block;
  border-radius: 18px;
}

#flip div:first-child {
  animation: show 5s linear infinite;
}

#flip div div {
  background: var(--secondary-color);
}
#flip div:first-child div {
  background:#DC143C;
}
#flip div:last-child div {
  background:#42c58a;
}

@keyframes show {
  0% {margin-top:-270px;}
  5% {margin-top:-180px;}
  33% {margin-top:-180px;}
  38% {margin-top:-90px;}
  66% {margin-top:-90px;}
  71% {margin-top:0px;}
  99.99% {margin-top:0px;}
  100% {margin-top:-270px;}
}

/*** Toast banner message style ***/
.toast {
  display: flex!important;
  top: 25px;
  right: 30px;
  border-radius: 18px;
  padding: 20px 35px 20px 25px;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transform: translateX(calc(100% + 30px));
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.25, 1.35);
}

.toastMessageSuccess {
  color: #155724;
  background-color: #d4edda;
  display: flex!important;
  top: 25px;
  right: 30px;
  border-radius: 18px;
  padding: 20px 35px 20px 25px;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
  border-left: 8px solid #155724;
  overflow: hidden;
  transform: translateX(calc(100% + 30px));
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.25, 1.35);
}
.toastMessageDanger {
  color: white;
  background-color: lightcoral;
  display: flex!important;
  top: 25px;
  right: 30px;
  border-radius: 18px;
  padding: 20px 35px 20px 25px;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
  border-left: 8px solid red;
  overflow: hidden;
  transform: translateX(calc(100% + 30px));
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.25, 1.35);
}

.toast.show{
  transform: translateX(0);
}
.toast-content{
  display: flex;
  justify-content: center;
  align-items: center;
}
.toast-visible {
  z-index: 1051;
}
.toast-header {
  background-color: transparent;
  border-bottom: 0;
}

/* Floating badge order item number */
.cart-button {
  color: white;
  font-weight: bold;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  border: 2px solid #ccc;
  border-radius: 50%;
  padding: 10px;
  font-size: 24px;
  background-color: var(--secondary-color);
}

.picker {
  border: 0.5px solid lightgray;
  border-radius: 18px;
  width: 20px;
  height: 20px;
  float: inline-end;
  margin: .25em;
}

.containerCustom1 {
  height: 100vh !important;
  display: grid!important;
  grid-template-rows: 17% 6% 55%!important;
}

.row1 {
  grid-row-start: 1;
  grid-row-end: 2;
}
.row2 {
  grid-row-start: 2;
  grid-row-end: 3;
}
.row3 {
  grid-row-start: 3;
  grid-row-end: 4;
  overflow-y: auto;
}

.containerCustom2 {
  height: 100vh !important;
  display: grid !important;
  grid-template-rows: 5% 5% 60% !important;
}
/*
.containerCustom1 {
  height: 100vh !important;
  display: grid !important;
  grid-template-rows: 5% 30% 40% !important;
  grid-template-columns: 20% 80%;
}

.row1 {
  grid-row-start: 1;
  grid-column-start: 1;
  grid-column-end: 2;
  width: min-content;
}
.row2 {
  grid-row-start: 1;
  grid-row-end: 2;
  grid-column-start: 2;
}
.row3 {
  grid-row-start: 2;
  overflow-y: auto;
  grid-column-start: 2;
}
.row4 {
  grid-row-start: 3;
  grid-column-start: 2;
  display: flex;
}
*/

/* gauge styles */
.gauge {
  width: 80px !important;
  height: 80px !important;
  max-width: 80px !important;
  max-height: 80px !important;
  flex: 0 0 80px;
  display: block;
}

.gauge svg {
  width: 100%;
  height: 100%;
}

.gauge .progressbar-text {
  font-size: 14px;
  font-weight: bold;
  color: #333;
}

.card canvas.gauge {
  width: 80px !important;
  height: 80px !important;
}

#gAvail,
#gPerf,
#gQual,
#gOee {
  width: 78px !important;
  height: 78px !important;
  max-width: 78px !important;
  max-height: 78px !important;
  display: block;
}

#timePie {
  max-width: 135px !important;
  max-height: 135px !important;
}

th.sortable {
  cursor: pointer;
  user-select: none;
}

.sort-icon {
  margin-left: 5px;
  font-size: 0.8em;
}

.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/****************************************
   ASSET DIAGRAM (styled tree view)
*****************************************/
#assetDiagram {
  display: block;
  transform-origin: top left;
}

#assetDiagram ul.asset-diagram-level {
  transition: transform 0.25s ease;
  transform-origin: top left;
}

:fullscreen #diagramView {
  background: #343a40;
  height: 100vh;
}

#diagramView:-webkit-full-screen {
  background: #343a40;
  height: 100vh;
}

.asset-diagram {
  margin: 20px auto;
  width: auto;
  min-height: auto;
  overflow-x: auto;
  height: -webkit-fill-available;
  /* justify-content: center; */
}

.asset-diagram ul {
  position: relative;
  padding-top: 20px;
  display: flex;
  justify-content: center;
}

.asset-diagram li {
  position: relative;
  padding: 20px 3px 0 3px;
  float: left;
  text-align: center;
  list-style-type: none;
}

/* Connectors */
.asset-diagram li::before,
.asset-diagram li::after {
  content: '';
  position: absolute;
  top: 0;
  right: 50%;
  width: 50%;
  height: 20px;
  border-top: 4px solid #ccc;
}

.asset-diagram li::after {
  left: 50%;
  right: auto;
  border-left: 4px solid #ccc;
}

.asset-diagram li:only-child::after,
.asset-diagram li:only-child::before {
  display: none;
}

.asset-diagram li:only-child {
  padding-top: 0;
}

.asset-diagram li:first-child::before,
.asset-diagram li:last-child::after {
  border: 0 none;
}

.asset-diagram li:last-child::before {
  border-right: 4px solid #ccc;
  border-radius: 0 5px 0 0;
}

.asset-diagram li:first-child::after {
  border-radius: 5px 0 0 0;
}

/* Vertical connector */
.asset-diagram ul ul::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  border-left: 4px solid #ccc;
  width: 0;
  height: 20px;
}

/* Card/Node Style */
.asset-node {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: #fff;
  color: #333;
  text-decoration: none;
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
  text-transform: none;
  min-width: 120px;
  transition: all 0.3s ease;
  box-shadow: 1px 2px 6px rgba(0,0,0,0.1);
}

.asset-node strong {
  font-size: 0.9rem;
}

.asset-node small {
  font-size: 0.8rem;
  color: #666;
}

.asset-node:hover,
.asset-node:hover + ul li a {
  color: #000;
  background: #c8e4f8;
  border: 4px solid lightcoral; /* colore bordi #94a0b4 */
}

.asset-node:hover + ul li::after,
.asset-node:hover + ul li::before,
.asset-node:hover + ul::before,
.asset-node:hover + ul ul::before {
  border-color: lightcoral; /* colore bordi #94a0b4 */
}

/* Responsive Fix */
@media (max-width: 768px) {
  .asset-diagram ul {
    flex-direction: column;
    align-items: center;
  }

  .asset-diagram li {
    float: none;
    margin: 0 auto;
  }

  .asset-node {
    min-width: 140px;
  }
}

.breadcrumb {
  border-radius: 15px!important;
  font-weight: bold;
}

.breadcrumb a,
.breadcrumb-item a {
  color: var(--app-primary-color, #794bff);
}

.breadcrumb a:hover,
.breadcrumb-item a:hover {
  color: var(--app-primary-color, #794bff);
  opacity: 0.82;
}

.btn-outline-primary {
  font-weight: bold;
}

/* ===== Asset header background by status ===== */
.asset-header {
  color: #fff;
  border-top-left-radius: .5rem;
  border-top-right-radius: .5rem;
  transition: background-color 0.4s ease;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.asset-header > div {
  min-width: 0;
}

.asset-header .badge,
.asset-header .asset-status-chip {
  border-radius: 999px !important;
  white-space: nowrap;
}

/* Stati principali */
.asset-running    { background-color: #28a745 !important; }  /* Verde */
.asset-stopped    { background-color: #dc3545 !important; }  /* Rosso */
.asset-idle       { background-color: #6c757d !important; }  /* Grigio neutro */

/* Altri stati asset (allineati agli event_types) */
.asset-starvation { background-color: #fd7e14 !important; }  /* Arancio */
.asset-builtback  { background-color: #007bff !important; }  /* Blu */
.asset-fault      { background-color: #ffc107 !important; color:#212529 !important; }  /* Giallo */

/* Table row selection highlight */
.table-primary-custom {
  background-color: #d1ecf1 !important;
}

/* card selezionata */
.rawEventCard.selected-card {
  border: 2px solid #17a2b8;
  box-shadow: 0 0 10px rgba(23, 162, 184, 0.6);
}

/* =========================================================
   vis-timeline tooltip modern (dark)
========================================================= */
.vis-tooltip {
  background: rgba(0,0,0,0.92) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 10px 12px !important;
  font-size: 13px !important;
  line-height: 1.25 !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25) !important;
  z-index: 999999 !important;
  pointer-events: none;
}

.vis-tooltip {
  transform: translateY(-6px);
}

.vis-tooltip .re-tooltip-title {
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 14px;
}

.vis-tooltip .re-tooltip-line {
  margin: 2px 0;
  opacity: 0.95;
}

.vis-tooltip b {
  font-weight: 700;
}

#timelineContainer,
#timelineContainer .card-body,
#timeline {
  overflow: visible !important;
}

/* =========================================================
   ORDER STATUS (global badge mapping)
========================================================= */
.badge-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: max-content;
  min-height: 25px;
  padding: 0.35rem 0.62rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 0.125rem 0.25rem rgba(15, 23, 42, 0.12);
}

/* status colors */
.badge-order.NEW       { background:#007bff !important; color:#fff !important; }
.badge-order.READY     { background:#ffc107 !important; color:#212529 !important; }
.badge-order.RUNNING   { background:#28a745 !important; color:#fff !important; }
.badge-order.PAUSED    { background:#6c757d !important; color:#fff !important; }
.badge-order.COMPLETED { background:#343a40 !important; color:#fff !important; }
.badge-order.CANCELLED { background:#dc3545 !important; color:#fff !important; }

.order-status-badge {
  display: inline-flex;
  margin-top: 0.3rem;
}

.btn-ghost,
.btn-soft-primary,
.btn-soft-success,
.btn-soft-danger {
  border: 1px solid var(--app-border) !important;
}

.app-table-page-controls .btn,
.app-table-tools .btn {
  border: 1px solid var(--app-border) !important;
}

.app-table-pagination .custom-select {
  min-height: 34px;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.app-list-action {
  margin: 0 !important;
  min-height: 40px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

form.app-list-action {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

form.app-list-action input[type="file"] {
  width: min(100%, 220px) !important;
  min-height: 40px;
}

.app-list-page > .d-flex:first-child,
.app-list-page > a.btn[href^="/new"],
.app-list-page > form[action^="/import"] {
  margin-bottom: 0 !important;
}

.app-list-page .app-table-tools {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  box-shadow: var(--app-shadow-soft);
  padding: 12px;
}

.app-list-page .app-view-toggle .btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

input.apple-switch,
.form-check-input.apple-switch {
  width: 50px !important;
  height: 30px !important;
  min-width: 50px !important;
  margin: 0 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  position: relative !important;
  cursor: pointer;
  border: 0 !important;
  border-radius: 999px !important;
  background: #d1d5db !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.12) !important;
  transition: background 0.2s ease !important;
  transform: none !important;
}

input.apple-switch::after,
.form-check-input.apple-switch::after {
  content: "" !important;
  position: absolute !important;
  top: 3px !important;
  left: 3px !important;
  width: 24px !important;
  height: 24px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18) !important;
  transition: transform 0.2s ease !important;
}

input.apple-switch:checked,
.form-check-input.apple-switch:checked {
  background: var(--app-primary-color, var(--app-success)) !important;
  border-color: transparent !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.12) !important;
}

input.apple-switch:checked::after,
.form-check-input.apple-switch:checked::after {
  left: 3px !important;
  transform: translateX(20px) !important;
}

.form-check-inline {
  align-items: center;
  gap: 8px;
  margin-right: 16px;
  margin-bottom: 10px;
}

.form-check-inline .form-check-label {
  vertical-align: middle !important;
  line-height: 30px;
  margin-bottom: 0;
}

.btn-group-toggle input[type="radio"],
.btn-group-toggle input[type="checkbox"] {
  position: absolute !important;
  clip: rect(0, 0, 0, 0) !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 1px !important;
  margin: 0 !important;
  pointer-events: none !important;
  opacity: 0 !important;
  box-shadow: none !important;
}

.app-form-page {
  max-width: 1180px;
  box-sizing: border-box;
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-form-header {
  max-width: 1120px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.app-back-button {
  min-height: 40px;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin: 0 !important;
}

.form-signin:not(main) {
  max-width: 1120px;
  min-height: 0;
}

.form-signin:not(main) > form,
main.container > form,
main.container-fluid > form {
  background: var(--app-surface) !important;
  border: 1px solid var(--app-border) !important;
  border-radius: var(--app-radius-lg) !important;
  box-shadow: var(--app-shadow-soft) !important;
  padding: 22px !important;
}

.app-form-page .form-signin:not(main) {
  margin-left: 0 !important;
  margin-right: auto !important;
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-form-page .form-signin:not(main) > form,
.app-form-page > form {
  max-width: 1120px;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.form-signin:not(main) > form,
.app-standard-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px 20px;
  align-items: start;
}

.form-signin:not(main) > form > h1,
.form-signin:not(main) > form > h2,
.form-signin:not(main) > form > h3,
.form-signin:not(main) > form > h4,
.app-standard-form > h1,
.app-standard-form > h2,
.app-standard-form > h3,
.app-standard-form > h4,
.form-signin:not(main) > form > input[type="hidden"],
.app-standard-form > input[type="hidden"],
.form-signin:not(main) > form > .alert,
.app-standard-form > .alert,
.form-signin:not(main) > form > .table-responsive,
.app-standard-form > .table-responsive,
.form-signin:not(main) > form > .app-table-tools,
.app-standard-form > .app-table-tools,
.form-signin:not(main) > form > .app-actions,
.app-standard-form > .app-actions,
.form-signin:not(main) > form > button,
.app-standard-form > button,
.form-signin:not(main) > form > .btn,
.app-standard-form > .btn,
.form-signin:not(main) > form > .row,
.app-standard-form > .row,
.form-signin:not(main) > form > .mt-4,
.app-standard-form > .mt-4,
.form-signin:not(main) > form > .material-conversions-section,
.app-standard-form > .material-conversions-section,
.form-signin:not(main) > form > hr {
  grid-column: 1 / -1;
}

.form-signin:not(main) > form > .form-group,
.form-signin:not(main) > form > .form-floating,
.app-standard-form > .form-group,
.app-standard-form > .form-floating {
  margin-bottom: 0;
  min-width: 0;
}

.form-signin:not(main) > form label,
main.container > form label,
main.container-fluid > form label {
  display: block;
  min-height: 20px;
  margin-bottom: 6px;
  color: var(--app-muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.form-signin:not(main) > form .form-control,
.form-signin:not(main) > form .custom-select,
main.container > form .form-control,
main.container > form .custom-select,
main.container-fluid > form .form-control,
main.container-fluid > form .custom-select {
  width: 100%;
  min-height: 42px;
}

.select2-container {
  width: 100% !important;
}

.select2-hidden-accessible {
  border: 0 !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  position: absolute !important;
  width: 1px !important;
  white-space: nowrap !important;
}

.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  width: 100% !important;
  min-height: 42px !important;
  border: 1px solid var(--app-border) !important;
  border-radius: var(--app-radius) !important;
  background: var(--app-surface-solid) !important;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05) !important;
  color: var(--app-text) !important;
  display: flex !important;
  align-items: center !important;
  transition: border-color 0.18s ease, box-shadow 0.18s ease !important;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--multiple {
  border-color: rgba(0, 123, 255, 0.45) !important;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.12), 0 10px 28px rgba(15, 23, 42, 0.06) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--app-text) !important;
  line-height: 40px !important;
  padding-left: 16px !important;
  padding-right: 62px !important;
  width: 100%;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: var(--app-muted) !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 40px !important;
  right: 10px !important;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
  position: absolute !important;
  top: 50% !important;
  right: 36px !important;
  z-index: 2 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 20px !important;
  height: 20px !important;
  margin: 0 !important;
  transform: translateY(-50%) !important;
  color: var(--app-muted) !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  text-align: center !important;
}

.select2-results__option .task-where-option {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.select2-results__option .task-where-option strong {
  color: var(--app-text);
  font-weight: 700;
}

.select2-results__option .task-where-option small {
  color: var(--app-muted);
  font-size: 0.78rem;
}

.select2-container--default .select2-results__option--selected {
  background: rgba(15, 23, 42, 0.06) !important;
  color: var(--app-text) !important;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background: rgba(0, 123, 255, 0.1) !important;
  color: var(--app-text) !important;
}

.select2-container--default .select2-results__option--highlighted .task-where-option strong,
.select2-container--default .select2-results__option--selected .task-where-option strong {
  color: var(--app-text) !important;
}

.select2-container--default .select2-results__option--highlighted .task-where-option small,
.select2-container--default .select2-results__option--selected .task-where-option small {
  color: var(--app-muted) !important;
}

.select2-container--default .select2-selection--multiple {
  padding: 4px 8px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  border: 1px solid var(--app-border) !important;
  border-radius: 999px !important;
  background: rgba(15, 23, 42, 0.06) !important;
  color: var(--app-text) !important;
  padding: 2px 9px 2px 6px !important;
  margin-top: 4px !important;
  line-height: 1.25 !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  position: static !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 18px !important;
  height: 18px !important;
  margin: 0 2px 0 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  color: var(--app-muted) !important;
  font-size: 14px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove span {
  display: block !important;
  line-height: 1 !important;
  transform: translateY(-1px);
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #dc2626 !important;
}

.select2-dropdown {
  border: 1px solid var(--app-border) !important;
  border-radius: var(--app-radius) !important;
  box-shadow: var(--app-shadow-soft) !important;
  overflow: hidden;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  min-height: 38px !important;
  border: 1px solid var(--app-border) !important;
  border-radius: var(--app-radius-sm) !important;
  outline: none !important;
}

.asset-checkbox-group {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 18px 28px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.asset-checkbox-group .form-check {
  margin-bottom: 0;
}

.opc-tags-page {
  max-width: none;
}

.opc-tags-page .opc-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  min-height: 42px;
  margin: 0 !important;
}

.opc-source-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  box-shadow: var(--app-shadow-soft);
  padding: 18px 20px;
  margin-bottom: 16px;
}

.opc-source-summary h1 {
  margin: 0;
  color: var(--app-text);
  font-size: 1.45rem;
  font-weight: 900;
}

.opc-script-field {
  grid-column: 1 / -1;
  min-width: 0;
}

.opc-script-editor {
  width: 100%;
  min-height: clamp(300px, 42vh, 520px);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 28px rgba(15, 23, 42, 0.08);
}

.opc-tag-switch-row,
.opc-tag-limits-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 14px;
  align-items: center;
}

.opc-tag-switch-row .form-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  min-height: 44px;
}

.opc-tag-switch-row .form-check-label {
  margin: 0;
  color: var(--app-text);
  font-weight: 700;
}

.opc-script-editor {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  min-height: clamp(240px, 36vh, 420px);
  background: #0f172a;
  color: #e5e7eb;
}

.opc-script-lines {
  padding: 14px 10px;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(229, 231, 235, 0.58);
  font: 13px/1.55 Consolas, "SFMono-Regular", Menlo, Monaco, monospace;
  text-align: right;
  user-select: none;
}

.opc-script-textarea {
  width: 100%;
  min-height: clamp(240px, 36vh, 420px);
  resize: vertical;
  border: 0;
  outline: none;
  padding: 14px 16px;
  background: transparent;
  color: #f8fafc;
  font: 13px/1.55 Consolas, "SFMono-Regular", Menlo, Monaco, monospace;
  tab-size: 2;
}

.opc-script-textarea::selection {
  background: rgba(121, 75, 255, 0.35);
}

@media (max-width: 767.98px) {
  .opc-tag-switch-row,
  .opc-tag-limits-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .opc-source-summary {
    align-items: flex-start;
    flex-direction: column;
  }
}

#scheduleForm {
  grid-template-columns: minmax(220px, 1.1fr) minmax(220px, 1.1fr) minmax(150px, 0.55fr) minmax(150px, 0.55fr);
}

#scheduleForm > .schedule-date-range {
  display: contents;
}

#scheduleForm > .schedule-template-section,
#scheduleForm > .schedule-active-field {
  grid-column: 1 / -1;
}

.schedule-template-section {
  width: 100%;
  margin-top: 4px;
}

.schedule-template-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.schedule-template-header h5 {
  margin: 0;
  color: var(--app-text);
  font-size: 1rem;
  font-weight: 900;
}

.schedule-template-wrap {
  width: 100%;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: var(--app-surface-solid);
  box-shadow: var(--app-shadow-soft);
  overflow: auto;
}

.schedule-template-table {
  min-width: 760px;
  margin-bottom: 0 !important;
}

.schedule-template-table thead th {
  border-top: 0 !important;
  border-bottom: 1px solid var(--app-border) !important;
  background: rgba(248, 250, 252, 0.9) !important;
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.schedule-template-table th,
.schedule-template-table td {
  border-left: 0 !important;
  border-right: 0 !important;
  border-color: rgba(226, 232, 240, 0.8) !important;
  vertical-align: middle !important;
}

.schedule-template-table tbody tr:last-child td {
  border-bottom: 0 !important;
}

.schedule-checkbox {
  width: 22px;
  height: 22px;
  cursor: pointer;
  accent-color: var(--secondary-color);
}

.schedule-active-field {
  margin-top: 2px;
  margin-bottom: 0 !important;
}

@media (max-width: 1199.98px) {
  #scheduleForm {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }
}

body.has-app-sidebar main.edit-list-page {
  height: 100dvh !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.edit-list-page {
  display: flex !important;
  flex-direction: column;
  min-height: 0;
}

.edit-list-page .edit-list-form-card {
  flex: 0 0 auto;
  max-width: none;
  min-height: 0;
  margin-left: 0 !important;
  margin-right: 0 !important;
  margin-bottom: 14px !important;
  overflow: hidden !important;
}

.edit-list-page .edit-list-form-card > form {
  max-width: none;
  max-height: none;
  overflow: visible;
  padding: 18px !important;
}

.edit-list-items-section {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 0;
}

.edit-list-items-section .app-list-title {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--app-text);
  font-size: 1.35rem;
  font-weight: 900;
}

.edit-list-items-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  box-shadow: var(--app-shadow-soft);
  padding: 12px 14px 14px;
  min-width: 0;
}

.edit-list-items-card .app-table-tools {
  flex: 0 0 auto;
  margin-bottom: 12px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.edit-list-items-card .app-table-wrap {
  flex: 1 1 auto;
  min-height: 220px;
  max-height: none;
  overflow: auto;
}

.edit-list-items-card .app-table {
  min-width: 960px;
}

@media (max-width: 767.98px) {
  .edit-list-items-card {
    padding: 10px;
  }

  .edit-list-items-card .app-table-tools {
    align-items: stretch;
  }
}

body.has-app-sidebar main.raw-events-page,
body.has-app-sidebar main.audit-trail-page {
  box-sizing: border-box;
  height: 100dvh !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column;
  overflow: hidden !important;
  gap: 12px;
}

.raw-events-page > h4,
.audit-trail-page > .d-flex,
.audit-trail-page > .alert {
  flex: 0 0 auto;
  margin-bottom: 0 !important;
}

.raw-events-filters,
.audit-filter-card {
  flex: 0 0 auto;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  border: 1px solid var(--app-border) !important;
  border-radius: var(--app-radius-lg) !important;
  box-shadow: var(--app-shadow-soft) !important;
  background: var(--app-surface) !important;
  margin-bottom: 0 !important;
  overflow: visible !important;
}

.raw-events-filters .card-body,
.audit-filter-card .card-body {
  min-height: 0 !important;
  padding: 14px !important;
}

.raw-events-filters .row,
.audit-filter-card .form-row {
  align-items: flex-end;
  row-gap: 10px;
}

.raw-events-filters .form-control,
.audit-filter-card .form-control {
  min-height: 40px !important;
}

.raw-events-filters label,
.audit-filter-card label {
  margin-bottom: 5px !important;
}

.raw-events-filters .mb-2,
.audit-filter-card .form-group {
  margin-bottom: 0 !important;
}

.raw-events-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.raw-events-shift-shell {
  display: grid;
  gap: 6px;
}

.raw-events-shift-nav {
  display: inline-grid !important;
  grid-template-columns: 44px minmax(96px, 1fr) 44px;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.raw-events-shift-nav .btn {
  min-width: 44px;
  height: 40px;
  padding: 0 !important;
  border-radius: 999px !important;
  box-shadow: none !important;
}

.raw-events-shift-nav #shiftCurrentBtn {
  min-width: 96px;
  padding: 0 14px !important;
  background: var(--app-primary-color, #111827) !important;
  border-color: var(--app-primary-color, #111827) !important;
  color: #fff !important;
  font-weight: 900 !important;
}

.raw-events-shift-label {
  min-width: 0;
  color: var(--app-muted);
  font-size: 0.82rem;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.raw-events-timeline {
  position: relative;
  flex: 0 0 auto;
  max-height: none;
  min-height: 0;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.95) !important;
  box-shadow: var(--app-shadow-soft) !important;
  overflow: visible !important;
  margin-bottom: 0 !important;
}

.raw-events-timeline-actions {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 4;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.raw-events-timeline #timelineCollapseBtn .timeline-toggle-icon {
  transition: transform 180ms ease;
}

.raw-events-timeline.is-collapsed {
  min-height: 64px;
  padding-bottom: 0;
}

.raw-events-timeline.is-collapsed #timeline,
.raw-events-timeline.is-collapsed .raw-events-timeline-message {
  display: none !important;
}

.raw-events-timeline.is-collapsed #timelineCollapseBtn .timeline-toggle-icon {
  transform: rotate(180deg);
}

.raw-events-timeline .card-body {
  position: relative;
  min-height: 0;
  overflow: visible !important;
  padding: 10px !important;
}

#timeline {
  height: var(--raw-events-timeline-height, 190px) !important;
  min-height: 130px !important;
  max-height: none !important;
  overflow: visible !important;
}

.raw-events-timeline.raw-events-timeline-asset-only #timeline {
  height: 150px !important;
  min-height: 150px !important;
}

.raw-events-timeline-message[hidden] {
  display: none !important;
}

.raw-events-timeline-message {
  margin: 0 0 8px;
  padding: 8px 12px;
  border: 1px solid rgba(59, 130, 246, 0.16);
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.08);
  color: var(--app-muted);
  font-weight: 800;
}

#timeline .vis-timeline {
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.94)) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.raw-events-timeline.raw-events-timeline-asset-only #timeline .vis-timeline {
  border-radius: 14px !important;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.94)) !important;
}

#timeline .vis-panel.vis-center,
#timeline .vis-panel.vis-top,
#timeline .vis-panel.vis-bottom,
#timeline .vis-panel.vis-left,
#timeline .vis-panel.vis-right {
  border-color: rgba(148, 163, 184, 0.14) !important;
}

#timeline .vis-panel.vis-center {
  border-radius: 0 0 14px 14px;
}

#timeline .vis-panel.vis-top {
  border-radius: 14px 14px 0 0;
}

#timeline .vis-grid.vis-vertical,
#timeline .vis-grid.vis-horizontal {
  border-color: rgba(148, 163, 184, 0.12) !important;
}

#timeline .vis-label,
#timeline .vis-labelset .vis-label {
  color: var(--app-text-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

#timeline .vis-item {
  border-width: 0 !important;
  border-radius: 3px !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

#timeline .vis-item .vis-item-content {
  padding: 2px 8px !important;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;
}

#timeline .vis-item.raw-event-lane-assetstatus .vis-item-content {
  padding: 0 !important;
}

#timeline .vis-item[class*="raw-event-lane-order-"],
#timeline .vis-item[class*="raw-event-lane-shift-"],
#timeline .vis-item[class*="raw-event-lane-custom-"],
#timeline .vis-item.raw-event-lane-task,
#timeline .vis-item.raw-event-lane-system,
#timeline .vis-item.raw-event-lane-custom,
#timeline .vis-item.raw-event-lane-assetevents,
#timeline .vis-item.raw-event-lane-eventmarkers {
  opacity: 0.95 !important;
}

#timeline .vis-item.raw-event-lane-eventmarkers {
  border-radius: 3px !important;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.1);
}

#timeline .vis-item.raw-event-lane-eventmarkers .vis-item-content {
  position: relative;
  padding: 3px 9px 3px 18px !important;
  white-space: nowrap;
}

#timeline .vis-item.raw-event-lane-eventmarkers .vis-item-content::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  transform: translateY(-50%);
  opacity: 0.9;
}

#timeline .vis-time-axis .vis-text {
  color: var(--text-muted);
  font-weight: 800;
  letter-spacing: 0;
}

#timeline .vis-time-axis .vis-text.vis-major {
  color: var(--text-color);
  font-weight: 900;
}

#timeline .vis-current-time {
  width: 2px !important;
  background: color-mix(in srgb, var(--app-primary-color, #794bff) 82%, transparent) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-primary-color, #794bff) 12%, transparent);
}

.task-script-snippets {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.88);
  padding: 16px;
  position: sticky;
  top: 96px;
  max-height: calc(100dvh - 128px);
  overflow: auto;
}

.task-script-snippets span {
  display: block;
  color: var(--muted-text, #64748b);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.task-script-snippets strong {
  display: block;
  color: var(--text-color, #111827);
  font-size: 0.9rem;
  margin-top: 2px;
}

.task-script-snippets-head {
  margin-bottom: 12px;
}

.task-snippet-group {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding: 10px 0;
}

.task-snippet-group summary {
  color: var(--app-text, #111827);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 900;
  list-style: none;
}

.task-snippet-group summary::-webkit-details-marker {
  display: none;
}

.task-snippet-group summary::after {
  content: "\f078";
  float: right;
  font-family: "Font Awesome 6 Free";
  font-size: 0.75rem;
  font-weight: 900;
  opacity: 0.55;
  transition: transform 0.18s ease;
}

.task-snippet-group[open] summary::after {
  transform: rotate(180deg);
}

.task-snippet-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.task-snippet-chip {
  border: 0;
  border-radius: 999px;
  background: #e5e7eb;
  color: #111827;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 8px 12px;
}

.task-snippet-chip:hover {
  background: #d1d5db;
}

.script-editor {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 18px;
  background: var(--app-surface-solid, #fff);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.script-editor.is-focused {
  border-color: rgba(0, 123, 255, 0.34);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08), 0 0 0 4px rgba(0, 123, 255, 0.08);
}

.script-editor[data-syntax-state="valid"] {
  border-color: rgba(34, 197, 94, 0.38);
}

.script-editor[data-syntax-state="invalid"] {
  border-color: rgba(239, 68, 68, 0.5);
}

.script-editor-toolbar,
.script-editor-status {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 8px 12px;
}

.script-editor-toolbar {
  background: rgba(248, 250, 252, 0.92);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.script-editor-title {
  color: var(--app-text, #111827);
  font-size: 0.8rem;
  font-weight: 900;
}

.task-field-calculation {
  grid-column: 1 / -1;
}

.script-editor-language {
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 4px 8px;
}

.script-editor-body {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  min-height: 116px;
  position: relative;
}

.script-editor.is-calculation .script-editor-body {
  min-height: 240px;
}

.script-editor-lines {
  background: #f8fafc;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  color: #94a3b8;
  font-family: Consolas, "SFMono-Regular", Menlo, Monaco, monospace;
  font-size: 0.86rem;
  line-height: 1.55;
  max-height: 210px;
  overflow: hidden;
  padding: 12px 8px;
  text-align: right;
  user-select: none;
}

.script-editor.is-calculation .script-editor-lines {
  max-height: 420px;
}

.script-editor-lines span {
  display: block;
}

.script-editor-input {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #0f172a;
  font-family: Consolas, "SFMono-Regular", Menlo, Monaco, monospace;
  font-size: 0.9rem;
  line-height: 1.55;
  max-height: 210px;
  min-height: 116px;
  overflow: auto;
  padding: 12px 14px;
  resize: vertical;
  white-space: pre;
}

.script-editor.is-calculation .script-editor-input {
  max-height: 420px;
  min-height: 240px;
}

.script-editor-input:focus {
  box-shadow: none !important;
  outline: none;
}

.script-editor-status {
  background: #fff;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  color: #64748b;
  font-size: 0.78rem;
  min-height: 34px;
}

.script-editor-status[hidden] {
  display: none;
}

.script-editor-suggestions {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  display: grid;
  max-height: 220px;
  overflow: auto;
  padding: 6px;
}

.script-editor-suggestions[hidden] {
  display: none;
}

.script-editor-suggestions button {
  align-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #0f172a;
  cursor: pointer;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 9px 10px;
  text-align: left;
}

.script-editor-suggestions button:hover,
.script-editor-suggestions button:focus {
  background: #f1f5f9;
  outline: none;
}

.script-editor-suggestions button span {
  font-family: Consolas, "SFMono-Regular", Menlo, Monaco, monospace;
  font-size: 0.84rem;
  font-weight: 800;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.script-editor-suggestions button strong {
  color: #64748b;
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.task-preview-refresh {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  white-space: nowrap;
}

.script-editor-status span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.script-editor-status strong {
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.72rem;
  padding: 5px 8px;
  white-space: nowrap;
}

.script-editor[data-syntax-state="valid"] .script-editor-status strong {
  background: #dcfce7;
  color: #166534;
}

.script-editor[data-syntax-state="invalid"] .script-editor-status {
  color: #b91c1c;
}

.script-editor[data-syntax-state="invalid"] .script-editor-status strong {
  background: #fee2e2;
  color: #991b1b;
}

.task-preview-shell {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.task-preview-context,
.task-preview-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 20px;
  background: #fff;
  padding: 18px;
}

.task-preview-context {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
  overflow: hidden;
}

.task-preview-context label {
  min-width: 0;
}

.task-preview-context .select2-container {
  width: 100% !important;
  max-width: 100%;
}

.task-preview-context .select2-selection__rendered {
  display: block !important;
  max-width: calc(100% - 30px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-preview-context .select2-selection__choice {
  max-width: calc(100% - 18px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-preview-context-title {
  color: var(--muted-text, #64748b);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.task-preview-card {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.task-preview-context-summary {
  display: grid;
  gap: 8px;
  color: var(--app-muted);
  font-size: 0.9rem;
}

.task-preview-context-summary div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--app-border);
  padding-bottom: 8px;
}

.task-preview-context-summary strong {
  color: var(--app-text);
}

.task-preview-context-summary span {
  text-align: right;
}

.task-preview-attachment-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px dashed var(--app-border);
  border-radius: 14px;
  color: var(--app-muted);
  font-size: 0.88rem;
  padding: 10px 12px;
}

.task-passfail-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.task-passfail-option {
  min-width: 0;
  min-height: 42px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.88);
  color: var(--app-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.task-passfail-option:hover:not(:disabled),
.task-passfail-option:focus:not(:disabled) {
  border-color: rgba(15, 23, 42, 0.18);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.task-passfail-option.is-pass.is-selected {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.14);
  color: #047857;
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.16);
}

.task-passfail-option.is-fail.is-selected {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.14);
}

.task-passfail-control.is-disabled .task-passfail-option,
.task-passfail-option:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
  box-shadow: none;
}

.task-list-control {
  display: block;
  width: 100%;
}

.ws-task-raise-event-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px dashed rgba(14, 165, 233, 0.32);
  border-radius: 14px;
  background: rgba(14, 165, 233, 0.08);
  color: #0369a1;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.25;
  padding: 10px 12px;
}

.task-number-control {
  display: grid;
  gap: 7px;
}

.task-number-control.is-out-of-range .form-control {
  border-color: rgba(239, 68, 68, 0.54);
  background: rgba(254, 242, 242, 0.92);
  color: #b91c1c;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.08), 0 10px 22px rgba(239, 68, 68, 0.08);
}

.task-number-limits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.task-number-limits span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.86);
  color: var(--app-muted);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
  padding: 6px 8px;
}

.task-number-limits small {
  color: var(--app-muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.task-number-limits strong {
  color: var(--app-text);
  font-size: 0.75rem;
  font-weight: 900;
}

.task-list-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.task-list-control.is-multi .task-list-options {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.task-list-option,
.task-tree-option {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.88);
  color: var(--app-text);
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 10px 12px;
  min-height: 44px;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.task-list-option:hover:not(:disabled),
.task-list-option:focus:not(:disabled),
.task-tree-option:hover:not(:disabled),
.task-tree-option:focus:not(:disabled) {
  border-color: rgba(0, 123, 255, 0.24);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.task-list-option.is-selected,
.task-tree-option.is-selected {
  border-color: color-mix(in srgb, var(--app-primary-color, #794bff) 46%, transparent);
  background: color-mix(in srgb, var(--app-primary-color, #794bff) 12%, transparent);
  color: #0f766e;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--app-primary-color, #794bff) 12%, transparent);
}

.task-list-option:disabled,
.task-tree-option:disabled,
.task-list-control.is-disabled .task-list-option,
.task-list-control.is-disabled .task-tree-option {
  cursor: not-allowed;
  opacity: 0.64;
  transform: none;
  box-shadow: none;
}

.task-list-option-mark,
.task-tree-branch {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.06);
  color: var(--app-muted);
  font-size: 0.82rem;
}

.task-list-option.is-selected .task-list-option-mark,
.task-tree-option.is-selected .task-tree-branch {
  background: color-mix(in srgb, var(--app-primary-color, #794bff) 18%, transparent);
  color: #0f766e;
}

.task-list-option-text,
.task-tree-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.task-list-option-text strong,
.task-tree-text strong {
  font-size: 0.88rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-list-option-text small,
.task-tree-text small {
  color: var(--app-muted);
  font-size: 0.74rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-tree-options {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  padding: 8px;
  background: rgba(248, 250, 252, 0.55);
}

.task-tree-node {
  display: grid;
  gap: 6px;
}

.task-tree-node.is-hidden {
  display: none;
}

.task-tree-option {
  padding-left: calc(10px + (var(--task-tree-depth, 0) * 18px));
}

.task-tree-children {
  display: grid;
  gap: 6px;
}

.task-list-empty {
  border: 1px dashed rgba(148, 163, 184, 0.36);
  border-radius: 14px;
  padding: 12px;
  color: var(--app-muted);
  font-weight: 800;
  background: rgba(248, 250, 252, 0.64);
}

.ws-task-attachment {
  display: grid;
  gap: 10px;
}

.ws-task-attachment-input {
  cursor: pointer;
}

.ws-task-attachment-preview {
  display: flex;
  align-items: flex-start;
}

.ws-task-attachment-thumb {
  border: 0;
  border-radius: 16px;
  background: #f8fafc;
  cursor: zoom-in;
  padding: 0;
  overflow: hidden;
  max-width: min(240px, 100%);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.ws-task-attachment-thumb img {
  display: block;
  width: 100%;
  max-height: 170px;
  object-fit: cover;
}

.ws-task-image-modal .modal-body {
  display: flex;
  justify-content: center;
  background: #0f172a;
  max-height: 78vh;
  overflow: auto;
}

.ws-task-image-modal img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.task-preview-hidden {
  border: 1px dashed rgba(100, 116, 139, 0.35);
  border-radius: 14px;
  color: #64748b;
  font-size: 0.9rem;
  padding: 12px;
}

@media (max-width: 900px) {
  .task-preview-shell {
    grid-template-columns: 1fr;
  }

  .task-item-editor-layout {
    grid-template-columns: 1fr;
  }

  .task-script-snippets {
    position: static;
    max-height: none;
  }
}

@media (max-width: 420px) {
  .task-passfail-control {
    grid-template-columns: 1fr;
  }
}

.raw-events-table,
.audit-table-wrap {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
}

.audit-detail-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.audit-detail-summary > div {
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.86);
}

.audit-detail-summary strong {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}

.audit-detail-path {
  word-break: break-word;
}

.audit-detail-json-panel,
.integration-log-json-panel {
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  background: #0f172a;
}

.integration-log-detail-modal .modal-dialog {
  max-width: min(1120px, calc(100vw - 28px));
}

.integration-log-detail-modal .modal-content {
  max-height: min(82vh, 760px);
}

.integration-log-detail-modal .modal-body {
  max-height: min(calc(82vh - 94px), 660px);
  overflow: auto;
}

.app-json-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px 9px 12px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.12);
}

.app-json-panel-head h6 {
  margin: 0;
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.app-json-panel-head .btn {
  width: 30px;
  height: 30px;
  color: #dbeafe;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.app-json-panel-head .btn:hover,
.app-json-panel-head .btn:focus,
.app-json-panel-head .btn.is-copied {
  color: #fff;
  background: rgba(var(--primary-color-rgb), 0.88);
}

.audit-detail-payload {
  max-height: 250px;
  overflow: auto;
  padding: 14px;
  border: 0;
  border-radius: 0;
  background: #0f172a;
  color: #e5edf7;
  font-size: 0.82rem;
  white-space: pre-wrap;
}

@media (max-width: 575.98px) {
  .audit-detail-summary {
    grid-template-columns: 1fr;
  }
}

.audit-trail-page > .app-table-tools,
.raw-events-page > .app-table-tools {
  flex: 0 0 auto;
  margin-bottom: 0;
}

.audit-table-wrap .app-table,
.raw-events-table .app-table {
  min-width: 980px;
}

main.container-fluid > form.audit-filter-card,
.audit-filter-card {
  padding: 0 !important;
}

.audit-filter-card .btn {
  min-height: 40px;
}

.audit-filter-card .select2-container {
  min-width: 0;
}

.audit-filter-card {
  position: relative;
  z-index: 30;
}

.audit-table-wrap {
  position: relative;
  z-index: 1;
}

.audit-filter-card .select2-dropdown {
  z-index: 1090;
}

.audit-filter-card .select2-results__options {
  max-height: 160px !important;
  overflow-y: auto !important;
}

.audit-filter-card .select2-container--open {
  z-index: 1090;
}

.event-health-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.event-health-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.event-health-summary > div,
.event-health-row {
  min-width: 0;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: rgba(248, 250, 252, 0.72);
}

.event-health-summary > div {
  padding: 12px 14px;
}

.event-health-summary span,
.event-health-row span,
.event-health-row small {
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.event-health-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--app-text);
  font-size: 1.25rem;
  font-weight: 900;
}

.event-health-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.event-health-results {
  display: grid;
  gap: 8px;
}

.event-health-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.event-health-row strong {
  display: block;
  color: var(--app-text);
  font-weight: 900;
}

@media (max-width: 991.98px) {
  body.has-app-sidebar main.raw-events-page,
  body.has-app-sidebar main.audit-trail-page {
    height: auto !important;
    min-height: 100dvh !important;
    overflow: visible !important;
  }

  .raw-events-table,
  .audit-table-wrap {
    max-height: 60vh;
  }

  .event-health-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .event-health-summary {
    grid-template-columns: 1fr;
  }

  .event-health-actions,
  .event-health-row {
    align-items: stretch;
    flex-direction: column;
  }
}

.material-conversions-section {
  width: 100%;
  margin-top: 0;
}

.material-conversions-section h4 {
  margin-bottom: 4px;
}

.material-conversions-section .text-muted {
  margin-bottom: 10px !important;
}

.material-conversions-section .app-table-tools {
  margin-bottom: 10px;
}

.material-conversions-section .app-table-actions {
  display: none;
}

.material-conversions-section .app-table-controls {
  width: 100%;
  justify-content: flex-end;
}

.material-conversions-section .app-table-search {
  width: min(100%, 260px);
}

.material-conversions-section .app-table-wrap {
  width: 100%;
  max-height: 280px;
}

.material-conversions-table {
  width: 100% !important;
  table-layout: fixed;
  margin-bottom: 12px !important;
}

.material-conversions-table th,
.material-conversions-table td {
  vertical-align: middle !important;
}

.material-conversions-table .form-control,
.material-conversions-table .select2-container {
  width: 100% !important;
}

.material-conversions-table + .btn,
#add-conversion-row {
  margin-top: 10px;
}

.form-signin:not(main) > form .form-check,
.form-signin:not(main) > form .form-check-inline {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
}

.form-signin:not(main) > form > button[type="submit"],
.form-signin:not(main) > form > .btn[type="submit"],
main.container > form > button[type="submit"],
main.container-fluid > form > button[type="submit"] {
  justify-self: start;
  min-width: 140px;
  min-height: 42px;
}

.form-signin:not(main) > form h1,
.form-signin:not(main) > form h2,
.form-signin:not(main) > form h3,
.form-signin:not(main) > form h4,
main.container > form h1,
main.container > form h2,
main.container > form h3,
main.container > form h4 {
  font-weight: 800;
  color: var(--app-text);
}

@media (max-width: 575.98px) {
  .form-signin:not(main) > form,
  .app-standard-form,
  main.container > form,
  main.container-fluid > form {
    display: block;
    max-height: none;
    overflow: visible;
    padding: 14px !important;
    border-radius: var(--app-radius) !important;
  }

  .app-form-page {
    height: auto;
    overflow: visible;
  }

  .app-form-page .form-signin:not(main) {
    overflow: visible;
  }

  .form-signin:not(main) > form > .form-group,
  .form-signin:not(main) > form > .form-floating,
  .app-standard-form > .form-group,
  .app-standard-form > .form-floating {
    margin-bottom: 1rem;
  }

  .app-form-header {
    margin-bottom: 10px;
  }
}

.app-settings-form,
.profile-password-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.app-color-field {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.app-color-picker {
  width: 48px;
  height: 42px;
  padding: 3px;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  background: #fff;
}

.app-settings-wide,
.profile-password-form .app-settings-wide {
  grid-column: 1 / -1;
}

.brand-preview-box {
  width: 220px;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(100, 116, 139, 0.28);
  border-radius: 16px;
  color: #64748b;
  font-weight: 800;
  background: var(--brand-preview-bg, #fff);
}

.brand-preview-box img {
  max-width: 90%;
  max-height: 80%;
  object-fit: contain;
}

.profile-layout {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.profile-avatar-large {
  width: 92px;
  height: 92px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: #111827;
  font-size: 2rem;
  font-weight: 900;
}

.profile-photo-actions {
  max-width: 360px;
}

.profile-data {
  display: grid;
  grid-template-columns: 160px 1fr;
  row-gap: 14px;
  margin-bottom: 0;
}

.profile-data dt {
  color: var(--app-text);
  font-weight: 900;
}

.profile-data dd {
  margin-bottom: 0;
}

.profile-language-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding-top: 18px;
  border-top: 1px solid var(--app-border);
}

.profile-language-form .select2-container {
  width: 100% !important;
}

.profile-notification-card {
  overflow: visible;
}

.profile-notification-form {
  display: grid;
  gap: 16px;
}

.profile-notification-panel {
  border: 1px solid var(--app-border);
  border-radius: 18px;
  padding: 16px;
  background: rgba(248, 250, 252, 0.66);
}

.profile-notification-panel:first-child {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
  gap: 16px;
  align-items: center;
}

.profile-notification-toggles,
.profile-notification-rules .task-switch {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-notification-toggles {
  flex-wrap: wrap;
}

.profile-notification-note {
  justify-self: end;
  max-width: 280px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.05);
  color: var(--app-muted);
  font-size: 0.84rem;
}

.profile-notification-note strong,
.profile-notification-note span {
  display: block;
}

.profile-notification-note strong {
  color: var(--app-text);
}

.profile-notification-table-wrap {
  overflow-x: auto;
}

.profile-notification-table th,
.profile-notification-table td {
  vertical-align: middle;
  white-space: nowrap;
}

.profile-notification-table th:not(:first-child),
.profile-notification-table td:not(:first-child) {
  width: 120px;
  text-align: center;
}

.profile-notification-rules-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.profile-favorite-list {
  display: grid;
  gap: 10px;
}

.profile-favorite-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.profile-favorite-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.78);
}

.profile-favorite-item a {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-color);
  font-weight: 800;
  text-decoration: none;
}

.profile-favorite-item a i {
  color: #111827;
  transform: rotate(45deg);
}

@media (max-width: 575.98px) {
  .profile-favorite-add {
    grid-template-columns: 1fr;
  }
}

.profile-notification-rules {
  display: grid;
  gap: 10px;
}

.profile-notification-rule {
  display: grid;
  grid-template-columns: minmax(190px, 1.4fr) minmax(170px, 1fr) repeat(3, auto) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: 16px;
  background: #fff;
}

.profile-notification-rule > *,
.profile-notification-panel > * {
  min-width: 0;
}

.profile-notification-rule .select2-container {
  width: 100% !important;
}

.profile-notification-rule label {
  margin-bottom: 0;
}

.profile-rule-remove {
  align-self: end;
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-notification-delivery-form {
  max-width: 1180px;
}

.app-notification-item {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  background: #f5f6f8;
  color: var(--app-text, #111827);
  text-align: left;
  box-shadow: none;
  overflow: hidden;
}

.app-notification-item + .app-notification-item {
  margin-top: 8px;
}

.app-notification-item.is-unread {
  border-color: rgba(var(--primary-color-rgb), 0.36);
  background: color-mix(in srgb, var(--app-primary-color, #794bff) 30%, #ffffff);
}

.app-notification-item > span:last-child {
  min-width: 0;
}

.app-notification-item strong,
.app-notification-item small,
.app-notification-item em {
  display: block;
  overflow-wrap: anywhere;
}

.app-notification-dot {
  width: 9px;
  height: 9px;
  margin-top: 7px;
  border-radius: 50%;
  background: rgba(100, 116, 139, 0.45);
}

.app-notification-item.is-unread .app-notification-dot {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.16);
}

.app-notification-show-more {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--app-text, #111827);
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.app-notification-show-more:hover,
.app-notification-show-more:focus {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1);
}

.app-form-separator {
  height: 1px;
  min-height: 1px;
  padding: 0;
  margin: 2px 0;
  background: var(--app-border);
}

.login-logo {
  max-width: 112px;
  max-height: 82px;
  object-fit: contain;
}

.login-wrap {
  min-height: calc(100vh - 56px);
  width: 100%;
  padding: 24px 16px;
  position: relative;
  z-index: 1;
}

.login-wrap .form-signin {
  width: min(100%, 430px);
  margin: 0 auto;
}

.login-wrap .form-signin > form {
  width: 100%;
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.14);
  padding: 32px;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
}

.login-brand {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--login-brand-bg, transparent);
}

.form-check {
  display: flex !important;
  align-items: center !important;
  gap: 10px;
  min-height: 34px;
  padding-left: 0 !important;
}

.form-check .form-check-input,
.form-check-inline .form-check-input {
  position: relative !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.form-check .form-check-label,
.form-check-inline .form-check-label {
  line-height: 1.25 !important;
  margin-bottom: 0 !important;
  vertical-align: middle !important;
}

.app-back-button {
  display: none !important;
}

.app-form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-top: 4px;
}

.app-form-actions .btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  min-width: 120px;
  width: auto !important;
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
  margin: 0 !important;
}

.task-form-page {
  max-width: 1240px;
}

.task-form-page .form-signin:not(main) {
  max-width: 1180px;
}

.task-form-card {
  gap: 14px 18px !important;
}

.task-item-editor-layout {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.task-item-editor-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.form-signin:not(main) > form > .task-form-section,
.app-standard-form > .task-form-section,
.form-signin:not(main) > form > .task-designer-entry,
.app-standard-form > .task-designer-entry {
  grid-column: 1 / -1;
}

.task-form-section {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: rgba(255, 255, 255, 0.72);
  padding: 16px;
}

.task-form-section-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 14px;
}

.task-form-section-title span {
  color: var(--app-muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.task-form-section-title strong {
  color: var(--app-text);
  font-size: 1rem;
}

.task-form-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: end;
}

.task-form-grid .form-group {
  grid-column: span 4;
  margin-bottom: 0;
  min-width: 0;
}

.task-form-grid .task-field-sm {
  grid-column: span 4;
}

.task-form-grid .task-field-md {
  grid-column: span 6;
}

.task-form-grid .task-field-lg {
  grid-column: span 8;
}

.task-form-grid .task-field-full {
  grid-column: 1 / -1;
}

.task-form-grid > .task-switch {
  grid-column: span 2;
  align-self: end;
}

.task-form-grid-compact .form-group {
  grid-column: span 3;
}

.task-form-grid-compact .task-field-md {
  grid-column: span 6;
}

.task-form-grid-compact .task-field-lg {
  grid-column: span 9;
}

.task-form-switches {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 24px;
}

.task-switch {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  margin: 0 !important;
  color: var(--app-text) !important;
  font-size: 0.9rem !important;
  font-weight: 800 !important;
}

.task-switch .apple-switch {
  flex: 0 0 auto;
}

.task-designer-entry {
  padding: 16px !important;
}

.task-designer-page {
  max-width: 1240px;
  min-height: calc(100dvh - 118px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.task-designer-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.task-designer-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-soft);
}

.task-designer-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 10px;
  min-width: min(100%, 560px);
}

.task-designer-meta span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface-solid);
  color: var(--app-text);
  font-weight: 800;
}

.task-designer-meta strong {
  color: var(--app-muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.task-designer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.task-designer-card {
  min-height: 170px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-soft);
  color: var(--app-text);
  text-decoration: none !important;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.task-designer-card.is-ready:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 123, 255, 0.36);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.task-designer-card.is-next {
  opacity: 0.72;
}

.task-designer-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(0, 123, 255, 0.1);
  color: var(--app-primary);
}

.task-designer-title {
  font-size: 1.05rem;
  font-weight: 900;
}

.task-designer-card small {
  min-height: 38px;
  color: var(--app-muted);
}

.task-designer-card strong {
  margin-top: auto;
  color: var(--app-primary);
  font-size: 0.9rem;
}

.task-designer-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-soft);
}

.task-version-badge {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  margin-top: 4px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0;
}

.task-version-badge.is-draft {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
}

.task-version-badge.is-live {
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(34, 197, 94, 0.14);
  color: #166534;
}

.task-version-badge.is-archived {
  border-color: rgba(100, 116, 139, 0.24);
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}

.task-designer-alert {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--app-radius);
  background: rgba(59, 130, 246, 0.08);
  color: #1d4ed8;
  font-weight: 900;
}

.task-designer-alert i {
  color: #2563eb;
}

.task-designer-shell {
  flex: 1 1 auto;
  min-height: 0;
  height: clamp(360px, calc(100dvh - 278px), 760px);
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 16px;
}

.task-designer-nav {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-soft);
}

.task-designer-nav-item {
  width: 100%;
  min-height: 50px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: var(--app-radius);
  background: transparent;
  color: var(--app-muted);
  font-weight: 900;
  text-align: left;
  transition: background 0.16s ease, color 0.16s ease;
}

.task-designer-nav-item strong {
  min-width: 28px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--app-text);
  font-size: 0.78rem;
  text-align: center;
}

.task-designer-nav-item.active {
  background: rgba(15, 23, 42, 0.08);
  color: var(--app-text);
}

.task-designer-content {
  min-height: 0;
  min-width: 0;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-soft);
  overflow: hidden;
}

.task-designer-panel {
  display: none;
  height: 100%;
  padding: 18px;
  overflow: auto;
}

.task-designer-panel.active {
  display: block;
}

.task-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.task-panel-header h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 900;
}

.task-builder-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
}

.task-item-palette {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-item-palette button {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface-solid);
  color: var(--app-text);
  font-weight: 900;
  text-align: left;
}

.task-item-canvas {
  min-height: 360px;
  max-height: calc(100dvh - 430px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px dashed rgba(100, 116, 139, 0.32);
  border-radius: var(--app-radius-lg);
  background: rgba(248, 250, 252, 0.7);
}

.task-item-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface-solid);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.task-item-card.is-dragging {
  opacity: 0.58;
}

.task-item-handle {
  cursor: grab;
  color: var(--app-muted);
}

.task-item-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.task-item-body strong,
.task-item-body span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-item-body span {
  color: var(--app-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.task-item-script-badge {
  min-width: 26px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--app-muted);
  font-size: 0.74rem;
}

.task-item-tags,
.task-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.task-empty-state {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--app-muted);
  text-align: center;
}

.app-empty-state {
  min-height: 220px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--app-muted) !important;
  text-align: center;
  box-shadow: none !important;
}

.app-empty-state.d-none {
  display: none !important;
}

.task-empty-state.compact {
  min-height: auto;
  align-items: flex-start;
  padding: 14px;
  border: 1px dashed rgba(100, 116, 139, 0.28);
  border-radius: var(--app-radius);
  background: rgba(248, 250, 252, 0.72);
}

.app-empty-state.compact {
  min-height: auto;
  align-items: flex-start;
  justify-content: center;
  padding: 14px !important;
  border: 1px dashed rgba(100, 116, 139, 0.28) !important;
  border-radius: var(--app-radius) !important;
  background: rgba(248, 250, 252, 0.72) !important;
  font-weight: 800;
}

.app-table-empty-row > td {
  padding: 12px !important;
  border: 0 !important;
  background: transparent !important;
}

.app-table-empty-row > td > .app-empty-state.compact {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  margin-top: 2px !important;
}

.app-empty-state.compact > .alert.app-empty-state.compact {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.task-inline-form {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: rgba(248, 250, 252, 0.7);
}

.task-inline-form .form-group {
  min-width: 170px;
  margin-bottom: 0;
}

.task-inline-form.is-disabled {
  opacity: 0.68;
}

.task-inline-grow {
  flex: 1 1 280px;
}

.task-field-xs {
  max-width: 110px;
}

.task-rule-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-rule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface-solid);
}

.task-rule-row span {
  min-width: 0;
}

.task-rule-row em {
  color: var(--app-muted);
  font-style: normal;
}

.task-permission-checks {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.task-edit-permission-pill {
  align-items: center;
  align-self: center;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  min-height: 40px;
  padding: 0 14px;
}

.task-check-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.task-check-pill span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: var(--app-surface-solid);
  color: var(--app-muted);
  font-weight: 900;
}

.task-check-pill input:checked + span {
  border-color: rgba(15, 23, 42, 0.16);
  background: rgba(15, 23, 42, 0.08);
  color: var(--app-text);
}

.task-version-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.task-version-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: var(--app-surface-solid);
}

.task-version-card span {
  color: var(--app-muted);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.76rem;
}

.task-version-card strong {
  color: var(--app-text);
  font-size: 1.4rem;
}

.task-version-card em {
  color: var(--app-muted);
  font-style: normal;
}

@media (max-width: 991.98px) {
  .task-form-grid,
  .task-form-grid-compact {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .task-form-grid .form-group,
  .task-form-grid .task-field-sm,
  .task-form-grid .task-field-md,
  .task-form-grid .task-field-lg,
  .task-form-grid > .task-switch,
  .task-form-grid-compact .form-group {
    grid-column: span 6;
  }

  .task-designer-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .task-designer-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
  }

  .task-designer-shell,
  .task-builder-layout {
    grid-template-columns: 1fr;
  }

  .task-designer-page {
    overflow: visible;
  }

  .task-designer-shell {
    height: auto;
    min-height: 0;
  }

  .task-designer-nav {
    flex-direction: row;
    overflow-x: auto;
  }

  .task-designer-nav-item {
    min-width: 170px;
  }

  .task-item-palette {
    flex-direction: row;
    overflow-x: auto;
  }

  .task-item-palette button {
    min-width: 150px;
  }

  .task-item-canvas {
    max-height: none;
  }

  .task-item-card {
    grid-template-columns: 26px minmax(0, 1fr);
  }

  .task-item-tags,
  .task-item-actions {
    grid-column: 2;
  }
}

@media (max-width: 575.98px) {
  .task-form-section {
    padding: 14px;
  }

  .task-designer-meta {
    grid-template-columns: 1fr;
  }

  .task-designer-actions {
    width: 100%;
  }

  .task-designer-actions .btn {
    flex: 1 1 auto;
  }
}

.password-toggle-text {
  min-width: 52px;
  color: #64748b !important;
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  font-weight: 800 !important;
  min-height: 34px;
  padding: 0 10px !important;
  border-radius: 999px !important;
}

.app-password-field {
  min-width: 0;
}

.app-password-field > label {
  display: block;
}

.app-password-group {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.app-password-group .form-control {
  width: 100% !important;
  flex: none !important;
  min-width: 0;
  padding-right: 76px !important;
  border-radius: var(--app-radius) !important;
}

.app-password-group .input-group-append {
  position: absolute;
  top: 50%;
  right: 8px;
  display: flex;
  align-items: center;
  transform: translateY(-50%);
  z-index: 5;
}

.app-password-group .password-toggle-text:hover,
.app-password-group .password-toggle-text:focus,
.login-wrap .password-toggle-text:hover,
.login-wrap .password-toggle-text:focus {
  color: var(--secondary-color) !important;
  background: rgba(15, 23, 42, 0.04) !important;
  outline: none !important;
  box-shadow: none !important;
}

.login-wrap .input-group {
  position: relative;
  display: block;
  width: 100%;
}

.login-wrap .input-group .form-control {
  width: 100% !important;
  flex: none !important;
  min-width: 0;
  padding-right: 76px !important;
  border-radius: var(--app-radius) !important;
}

.login-wrap .input-group .password-toggle-text {
  position: absolute;
  top: 50%;
  right: 8px;
  z-index: 5;
  transform: translateY(-50%);
}

.login-password-field > label,
.login-username-field > label {
  display: block;
  margin-bottom: 6px;
  padding: 0;
  color: var(--app-muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.login-username-field .form-control {
  width: 100% !important;
  min-height: 42px;
  border-radius: var(--app-radius) !important;
}

.login-wrap .btn-outline-secondary {
  color: var(--app-primary-color, #794bff) !important;
  background: color-mix(in srgb, var(--app-primary-color, #794bff) 7%, #ffffff) !important;
  border-color: color-mix(in srgb, var(--app-primary-color, #794bff) 18%, #ffffff) !important;
  font-weight: 800;
}

.login-wrap .btn-outline-secondary:hover,
.login-wrap .btn-outline-secondary:focus {
  color: #ffffff !important;
  background: var(--app-primary-color, #794bff) !important;
  border-color: var(--app-primary-color, #794bff) !important;
}

@media (max-width: 575.98px) {
  .login-wrap {
    min-height: calc(100vh - 56px);
    padding: 16px 10px;
  }

  .login-wrap .form-signin > form {
    padding: 26px 22px;
  }
}

.translations-page .translation-language-form {
  padding: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

.translation-language-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(560px, 1.22fr);
  gap: var(--app-gap);
}

.translation-language-list {
  display: grid;
  gap: 10px;
}

.translation-language-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: rgba(255, 255, 255, 0.5);
}

.translation-language-update {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(150px, 1fr) minmax(110px, auto) auto;
  gap: 10px;
  align-items: center;
  margin: 0;
  min-width: 0;
}

.translation-language-delete {
  margin: 0;
}

.translation-language-delete .btn,
.translation-language-update .btn {
  white-space: nowrap;
}

.translation-language-row small {
  display: block;
  color: var(--app-muted);
  font-weight: 800;
}

.translation-label-card {
  min-height: 0;
}

.translation-label-card .app-card-header {
  align-items: flex-end;
}

.translation-locale-picker {
  min-width: min(100%, 360px);
}

.translation-locale-picker .select2-container {
  width: 100% !important;
}

.translation-locale-picker .select2-dropdown {
  z-index: 2100;
}

.translation-locale-picker .select2-results__options {
  max-height: 260px !important;
}

.translation-info-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(59, 130, 246, 0.16);
  border-radius: var(--app-radius);
  background: rgba(59, 130, 246, 0.08);
  color: var(--app-text);
}

.translation-info-banner i {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.translation-info-banner strong,
.translation-info-banner span {
  display: block;
}

.translation-info-banner span {
  color: var(--app-muted);
  font-weight: 700;
}

.translation-label-form .app-table-wrap {
  max-height: 58vh;
}

.translation-label-form .app-table {
  min-width: 860px;
}

.translation-label-form code {
  color: #1d4ed8;
  font-weight: 800;
}

.translation-missing {
    border-color: rgba(244, 63, 94, 0.42) !important;
    background: rgba(255, 241, 242, 0.72) !important;
  }

.app-field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.app-field-label-row label {
  margin-bottom: 0;
}

.app-local-translation-button {
  min-width: 34px;
  min-height: 30px;
  padding: 0.25rem 0.5rem !important;
  border-radius: 999px !important;
}

.local-translation-source {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  background: var(--app-soft-bg);
}

.local-translation-source small {
  color: var(--app-muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.app-local-translation-modal .modal-body {
  max-height: min(62vh, 560px);
  overflow: auto;
}

.translation-create-label-form {
  padding: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

@media (max-width: 1199.98px) {
  .translation-language-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .translation-language-row {
    grid-template-columns: 1fr;
  }

  .translation-language-update {
    grid-template-columns: 1fr;
  }

  .translation-language-delete {
    justify-self: start;
  }

  .profile-language-form {
    grid-template-columns: 1fr;
  }

  .translation-label-card .app-card-header {
    align-items: stretch;
    flex-direction: column;
  }

  .translation-locale-picker {
    width: 100%;
  }
}

.order-filter-panel {
  margin-bottom: 14px;
}

.order-filter-panel .form-check {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 30px;
  margin-right: 14px;
  margin-bottom: 8px;
}

.order-filter-panel .apple-switch {
  width: 44px !important;
  min-width: 44px !important;
  height: 26px !important;
}

.order-filter-panel .apple-switch::after {
  width: 20px !important;
  height: 20px !important;
}

.order-filter-panel .apple-switch:checked::after {
  transform: translateX(18px) !important;
}

.order-filter-panel label {
  margin-bottom: 4px;
  font-weight: 800;
}

.order-filter-statuses {
  display: flex;
  align-items: center;
  gap: 4px 8px;
  flex-wrap: wrap;
}

.app-table td .btn,
.app-table .btn-sm {
  min-width: 38px;
  min-height: 34px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  margin: 2px;
}

.app-table td .btn-info,
.app-table td .btn-outline-info {
  color: #1d4ed8 !important;
  background: rgba(59, 130, 246, 0.12) !important;
  border: 1px solid rgba(59, 130, 246, 0.18) !important;
}

.app-table td .btn-danger {
  color: #b91c1c !important;
  background: rgba(239, 68, 68, 0.12) !important;
  border: 1px solid rgba(239, 68, 68, 0.18) !important;
}

.app-table td .btn-primary {
  color: #4338ca !important;
  background: rgba(99, 102, 241, 0.12) !important;
  border: 1px solid rgba(99, 102, 241, 0.18) !important;
}

.profile-avatar-large {
  object-fit: cover;
  border: 1px solid var(--app-border);
}

.profile-photo-form,
.profile-photo-remove {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

#uom-conversions-table {
  min-width: 720px;
}

#uom-conversions-table input,
#uom-conversions-table select {
  min-width: 110px;
}

.scheduler-page-wrap {
  box-sizing: border-box;
  height: 100dvh;
  min-height: 0;
  width: auto !important;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

.scheduler-page-wrap.mt-4 {
  margin-top: 0 !important;
}

.scheduler-page-wrap > h4,
.scheduler-page-wrap > .scheduler-page-header {
  flex: 0 0 auto;
  margin-bottom: 0 !important;
}

.scheduler-toolbar {
  flex: 0 0 auto;
  margin-bottom: 0 !important;
  border: 0 !important;
  border-radius: var(--app-radius-lg) !important;
  box-shadow: var(--app-shadow) !important;
  background: var(--app-surface-solid) !important;
}

.scheduler-toolbar .card-body {
  padding: 16px !important;
}

.scheduler-toolbar-row {
  display: grid;
  grid-template-columns: minmax(280px, auto) minmax(260px, 420px) minmax(360px, 1fr);
  gap: 16px;
  align-items: end;
}

.scheduler-primary-tools,
.scheduler-nav,
.status-inline-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.scheduler-view-toggle {
  padding: 4px;
  border-radius: 18px;
  background: rgba(226, 232, 240, 0.7);
}

.scheduler-view-toggle .btn {
  min-width: 78px;
  box-shadow: none !important;
  background: transparent !important;
}

.scheduler-view-toggle .btn.active {
  color: var(--app-text) !important;
  background: #fff !important;
  box-shadow: var(--app-shadow-soft) !important;
}

.scheduler-filter-group label,
.scheduler-status-filter label {
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
}

.scheduler-status-filter .form-check {
  margin-right: 8px !important;
}

.scheduler-status-filter .apple-switch {
  width: 44px !important;
  min-width: 44px !important;
  height: 26px !important;
}

.scheduler-status-filter .apple-switch::after {
  width: 20px !important;
  height: 20px !important;
}

.scheduler-status-filter .apple-switch:checked::after {
  transform: translateX(18px) !important;
}

.scheduler-layout {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  display: block;
}

.scheduler-board-card {
  height: 100%;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--app-radius-lg);
  background: var(--app-surface-solid);
  box-shadow: var(--app-shadow);
  overflow: hidden;
}

.scheduler-editor-card {
  position: fixed;
  top: calc(var(--app-topbar-h, 72px) + 92px);
  right: var(--app-shell-pad-x, 24px);
  bottom: 24px;
  z-index: 1250;
  width: min(420px, calc(100vw - var(--app-sidebar-w, 280px) - 64px));
  min-height: 0;
  display: none;
  flex-direction: column;
  border-radius: var(--app-radius-lg);
  background: var(--app-surface-solid);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

body.app-sidebar-collapsed .scheduler-editor-card {
  width: min(420px, calc(100vw - var(--app-sidebar-collapsed-w, 84px) - 64px));
}

.scheduler-editor-card.is-open {
  display: flex;
}

.scheduler-editor-close {
  width: 36px;
  min-width: 36px;
  min-height: 36px !important;
  padding: 0 !important;
  border-radius: 50% !important;
}

.scheduler-board-card .card-header,
.scheduler-editor-card .card-header {
  flex: 0 0 auto;
  background: transparent;
  border-bottom: 1px solid var(--app-border);
  padding: 16px 18px;
}

.scheduler-board-card .card-body,
.scheduler-editor-card .card-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.scheduler-scroll {
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.scheduler-grid {
  min-width: 1120px;
  min-height: 100%;
  display: grid;
  gap: 0;
  border: 1px solid var(--app-border);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.scheduler-asset-row {
  min-height: 92px;
}

.scheduler-header-row,
.scheduler-asset-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

.scheduler-header-label,
.scheduler-asset-label {
  padding: 14px;
  border-right: 1px solid var(--app-border);
  border-bottom: 1px solid var(--app-border);
  background: rgba(248, 250, 252, 0.9);
}

.scheduler-header-timeline,
.scheduler-asset-timeline {
  min-width: 0;
  border-bottom: 1px solid var(--app-border);
}

.scheduler-time-grid {
  display: grid;
  height: 52px;
}

.scheduler-time-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--app-border);
  color: var(--app-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.scheduler-time-cell.today-cell {
  color: #0f172a;
  background: rgba(255, 204, 0, 0.22);
}

.scheduler-lane {
  position: relative;
  min-height: 86px;
  height: 100%;
  background-color: #fff;
}

.scheduler-empty {
  position: absolute;
  top: 32px;
  left: 18px;
  color: var(--app-muted);
  font-style: italic;
}

.scheduler-today-highlight {
  position: absolute;
  inset-block: 0;
  background: rgba(255, 204, 0, 0.16);
  pointer-events: none;
}

.order-block {
  position: absolute;
  min-width: 46px;
  height: 64px;
  padding: 8px 10px;
  border-radius: 12px;
  color: #fff;
  box-shadow: var(--app-shadow-soft);
  cursor: pointer;
  overflow: hidden;
  z-index: 2;
  touch-action: none;
  user-select: none;
}

.scheduler-page-wrap .btn,
.scheduler-page-wrap .form-control,
.scheduler-page-wrap .select2-selection {
  min-height: 42px;
}

.order-block.master-order { background: #334155; }
.order-block.instance-order { background: #0ea5e9; }
.order-block.standard-order { background: #22c55e; }
.order-block.cancelled-order { background: #64748b; opacity: 0.8; }
.order-block.selected { outline: 2px solid var(--app-primary); outline-offset: 2px; }
.order-block.not-editable-order { cursor: default; }
.order-block.has-overlap-warning { box-shadow: 0 0 0 2px rgba(255, 204, 0, 0.8), var(--app-shadow-soft); }

.order-block .order-title {
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-block .order-subtitle {
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-status-badge {
  margin-top: 4px;
  font-size: 0.64rem;
}

.scheduler-editor-body {
  overflow-y: auto;
  min-height: 0;
}

.edit-lock-warning-box,
.overlap-warning-box {
  display: none;
}

.ws-workstation-page .ws-page {
  box-sizing: border-box;
  height: 100dvh;
  min-height: 0;
  width: auto !important;
  overflow: hidden;
}

.ws-workstation-page .ws-page.container-fluid {
  padding-left: var(--app-shell-pad-x, 24px) !important;
  padding-right: var(--app-shell-pad-x, 24px) !important;
}

.ws-page-shell {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.ws-breadcrumb-wrap {
  flex: 0 0 auto;
}

.ws-layout-row {
  flex: 1 1 auto;
  min-height: 0;
  margin-left: -8px !important;
  margin-right: -8px !important;
  display: flex;
  flex-wrap: wrap;
}

.ws-col-left,
.ws-col-right {
  min-height: 0;
  padding-left: 8px !important;
  padding-right: 8px !important;
}

.sticky-desktop,
.ws-left-fixed,
.ws-right-stack {
  height: 100%;
  min-height: 0;
  width: 100%;
}

.ws-left-fixed,
.ws-right-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ws-card,
.ws-soft-card,
.tab-panel-card,
.filters-shell .global-filters-card {
  border: 0;
  border-radius: var(--app-radius-lg);
  background: var(--app-surface-solid);
  box-shadow: var(--app-shadow);
}

.order-card {
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  overflow: hidden;
}

.order-card .card-header {
  flex: 0 0 auto;
  border: 0;
  padding: 16px 18px;
}

.order-card .card-body {
  overflow: auto;
  padding: 16px 18px;
}

.po-actions-card,
.filters-shell,
.segment-tabs-wrap {
  flex: 0 0 auto;
}

.po-actions-card .card-body {
  padding: 14px !important;
}

.global-filters-card {
  padding: 14px 14px 6px !important;
}

.global-filters-card .form-group {
  margin-bottom: 8px !important;
}

.global-filters-card label {
  color: var(--app-muted);
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 5px;
}

.global-filters-card .input-group {
  display: flex;
  flex-wrap: nowrap;
}

.global-filters-card .input-group .form-control {
  min-width: 0;
}

.global-filters-card .input-group-prepend,
.global-filters-card .input-group-append {
  flex: 0 0 auto;
}

.global-filters-card .input-group .btn {
  min-width: 42px;
  min-height: 42px;
  padding-left: 12px !important;
  padding-right: 12px !important;
}

.ws-filter-segments {
  display: inline-flex;
  align-items: center;
  justify-content: stretch;
  gap: 4px;
  width: 100%;
  padding: 5px;
  border-radius: 16px;
  background: #eef2f6;
  box-shadow: inset 0 0 0 1px rgba(226, 232, 240, .8);
  overflow: hidden;
}

.app-segment-control {
  position: relative;
  isolation: isolate;
}

.app-segment-indicator {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
  pointer-events: none;
  opacity: 0;
  transition:
    transform 220ms cubic-bezier(.2, .8, .2, 1),
    width 220ms cubic-bezier(.2, .8, .2, 1),
    height 220ms cubic-bezier(.2, .8, .2, 1),
    opacity 120ms ease;
}

.ws-filter-segment {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-width: 0;
  min-height: 38px;
  border: 0 !important;
  border-radius: 12px !important;
  background: transparent !important;
  color: #334155;
  font-size: clamp(0.78rem, 0.72vw, 0.9rem);
  font-weight: 900 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: none !important;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.ws-filter-segment:hover {
  background: rgba(255, 255, 255, 0.7) !important;
}

.ws-filter-segment.active {
  background: transparent !important;
  color: #111827;
  box-shadow: none !important;
}

.ws-period-nav {
  display: grid;
  grid-template-columns: 44px minmax(96px, 132px) 44px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ws-period-btn,
.ws-period-current {
  height: 40px;
  min-height: 40px;
  border: 0 !important;
  border-radius: 999px !important;
  font-weight: 900 !important;
  box-shadow: none !important;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.ws-period-btn {
  width: 44px;
  min-width: 44px;
  padding: 0;
  background: #fff !important;
  color: #334155 !important;
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
}

.ws-period-current {
  min-width: 0;
  padding: 0 14px;
  background: var(--app-primary-color, #111827) !important;
  color: #fff !important;
  border: 1px solid var(--app-primary-color, #111827) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-period-current:hover {
  background: var(--app-primary-color, #111827) !important;
  box-shadow: none !important;
}

.ws-period-btn:hover {
  background: #f8fafc !important;
  color: #111827 !important;
  box-shadow: none !important;
}

.ws-period-label {
  min-width: 0;
  padding: 0 4px;
  color: var(--app-muted);
  font-size: clamp(0.82rem, 0.82vw, 0.95rem);
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 767.98px) {
  .ws-filter-segments {
    width: 100%;
  }

  .ws-filter-segment {
    min-height: 36px;
    font-size: 0.82rem;
  }

  .ws-period-nav {
    grid-template-columns: 42px minmax(104px, 1fr) 42px;
  }

  .ws-period-label {
    grid-column: 1 / -1;
    padding-left: 2px;
    white-space: normal;
  }

  .ws-period-btn,
  .ws-period-current {
    height: 42px;
  }

  .ws-period-btn {
    width: 42px;
    min-width: 42px;
  }
}

.po-actions-grid {
  display: grid;
  gap: 10px;
}

.metrics-grid,
.dates-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric-box,
.date-box {
  border: 1px solid var(--app-border);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.85);
  padding: 12px;
  min-width: 0;
}

.metric-label {
  color: var(--app-muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-value {
  color: var(--app-text);
  font-size: 1.05rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.tab-shell {
  flex: 1 1 auto;
  min-height: 0;
}

.tab-panel-card {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tab-panel-card .tab-content,
.tab-panel-card .tab-pane {
  height: 100%;
  min-height: 0;
}

.tab-panel-card .tab-pane.show.active {
  display: flex;
  flex-direction: column;
}

.tab-scroll-area {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.tab-scroll-area > .table-responsive,
.tab-scroll-area .app-table-wrap {
  max-height: none !important;
}

.segment-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 4px;
  padding: 5px;
  border-radius: 16px;
  background: #eef2f6;
  box-shadow: inset 0 0 0 1px rgba(226, 232, 240, .8);
  overflow: hidden;
}

.segment-tabs .nav-link {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  text-align: center;
  border-radius: 12px !important;
  color: var(--app-muted);
  font-weight: 900;
  box-shadow: none !important;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.segment-tabs .nav-link.active {
  color: var(--app-text);
  background: transparent !important;
  box-shadow: none !important;
}

#downtimeMain,
#dtTableView {
  min-height: 0;
}

#downtimeMain {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.local-tools {
  flex: 0 0 auto;
  display: grid;
  gap: 6px;
}

.local-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.local-toolbar-left,
.local-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.local-tools-toggle {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--app-border) !important;
  border-radius: 999px !important;
  background: var(--app-surface-solid);
  color: var(--app-text);
  box-shadow: var(--app-shadow-soft);
  font-weight: 800;
}

.local-tools-panel {
  display: none;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--app-shadow-soft);
  padding: 14px;
}

.local-tools-panel.open {
  display: block;
}

.compact-filter-row {
  margin-right: -6px;
  margin-left: -6px;
}

.compact-filter-row > [class*="col-"] {
  padding-right: 6px;
  padding-left: 6px;
}

.compact-filter-row label {
  color: var(--app-muted);
  font-size: 0.8rem;
  margin-bottom: 5px;
}

#dtTableView {
  flex: 1 1 auto;
  min-height: 180px;
  overflow: auto;
}

#dtTimeline {
  height: clamp(180px, 26vh, 280px);
  min-height: 190px;
  max-height: 260px;
  border-radius: 16px;
  overflow: hidden;
}

#dtTimeline .vis-timeline {
  border: 1px solid var(--app-border) !important;
  border-radius: 16px;
}

#kpiTab .card {
  border: 0;
  border-radius: var(--app-radius-md);
  box-shadow: var(--app-shadow-soft);
}

#kpiTab .tab-scroll-area,
#kpiTab .card-body {
  min-width: 0;
}

#kpiTab .card-body canvas {
  width: 100% !important;
}

#kpiTab .row {
  margin-right: -6px;
  margin-left: -6px;
}

#kpiTab .row > [class*="col-"] {
  padding-right: 6px;
  padding-left: 6px;
}

#kpiTab canvas:not(#gAvail):not(#gPerf):not(#gQual):not(#gOee):not(#timePie) {
  max-height: 210px;
}

#ordersTab .table-responsive,
#dtTableView {
  border-radius: 16px;
}

@media (max-width: 1199.98px) {
  .scheduler-toolbar-row {
    grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
  }

  .scheduler-status-filter {
    grid-column: 1 / -1;
  }

  .scheduler-layout {
    overflow: visible;
  }

  .scheduler-editor-card {
    top: auto;
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
    max-height: min(620px, 78dvh);
  }

  .scheduler-page-wrap {
    height: auto;
    min-height: calc(100dvh - var(--app-topbar-h, 72px));
    overflow: visible;
  }
}

@media (max-width: 991.98px) {
  .ws-workstation-page .ws-page {
    height: auto;
    min-height: calc(100dvh - var(--app-topbar-h, 72px));
    overflow: visible;
  }

  .sticky-desktop,
  .ws-left-fixed,
  .ws-right-stack,
  .tab-panel-card {
    height: auto;
  }

  .ws-layout-row {
    display: block;
  }

  .ws-col-left,
  .ws-col-right {
    max-width: 100%;
  }

  .order-card,
  .tab-shell {
    min-height: 0;
  }

  .tab-scroll-area,
  .order-card .card-body {
    overflow: visible;
  }
}

@media (max-width: 575.98px) {
  .scheduler-toolbar-row {
    grid-template-columns: 1fr;
  }

  .scheduler-grid {
    min-width: 900px;
  }

  .segment-tabs {
    grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
    gap: 6px;
    padding: 6px;
  }

  .segment-tabs .nav-link {
    min-height: 42px;
    padding: 0.45rem 0.35rem;
    font-size: 0.95rem;
  }

  .segment-tabs .nav-link .tab-label {
    display: none;
  }

  .segment-tabs .segment-badge {
    position: absolute;
    top: 2px;
    right: 4px;
  }

  .metrics-grid,
  .dates-grid {
    grid-template-columns: 1fr;
  }
}

#uom-conversions-table .select2-container {
  min-width: 180px !important;
}

.shift-calendar-page {
  padding-bottom: 18px !important;
}

.shift-calendar-page #calendarContainer {
  min-height: 0;
}

@media (max-width: 767.98px) {
  .app-settings-form,
  .profile-password-form,
  .profile-layout,
  .profile-data {
    grid-template-columns: 1fr;
  }

  .app-color-field {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .app-color-field .btn {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

/* Workstation final layout guards */
body.ws-workstation-page.has-app-sidebar main.ws-page {
  box-sizing: border-box !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.ws-workstation-page .ws-page-shell,
body.ws-workstation-page .ws-layout-row,
body.ws-workstation-page .ws-col-left,
body.ws-workstation-page .ws-col-right,
body.ws-workstation-page .sticky-desktop,
body.ws-workstation-page .ws-left-fixed,
body.ws-workstation-page .ws-right-stack,
body.ws-workstation-page .tab-shell,
body.ws-workstation-page .tab-panel-card,
body.ws-workstation-page .tab-panel-card .tab-content,
body.ws-workstation-page .tab-panel-card .tab-pane.show.active {
  min-height: 0 !important;
}

body.ws-workstation-page .ws-page-shell {
  height: 100% !important;
}

body.ws-workstation-page .ws-layout-row {
  height: auto !important;
  flex: 1 1 auto !important;
}

body.ws-workstation-page .sticky-desktop,
body.ws-workstation-page .ws-left-fixed,
body.ws-workstation-page .ws-right-stack {
  height: 100% !important;
}

body.ws-workstation-page .order-card {
  flex: 0 0 auto !important;
  min-height: 260px !important;
  max-height: clamp(300px, 52vh, 520px) !important;
  display: flex !important;
  flex-direction: column !important;
}

body.ws-workstation-page .order-card .card-body {
  min-height: 0 !important;
  overflow: auto !important;
}

body.ws-workstation-page .po-actions-card {
  flex: 0 0 auto !important;
}

body.ws-workstation-page .tab-shell {
  flex: 1 1 auto !important;
  overflow: hidden !important;
}

body.ws-workstation-page .tab-panel-card {
  height: 100% !important;
  overflow: hidden !important;
}

body.ws-workstation-page .tab-panel-card .tab-content,
body.ws-workstation-page .tab-panel-card .tab-pane.show.active {
  height: 100% !important;
}

body.ws-workstation-page .tab-scroll-area {
  height: 100% !important;
  min-height: 0 !important;
  overflow: auto !important;
  padding: 14px !important;
}

body.ws-workstation-page .app-table-tools {
  min-height: 0 !important;
  margin: 0 0 12px !important;
  padding: 10px 12px !important;
  border: 1px solid var(--app-border) !important;
  border-radius: var(--app-radius-lg) !important;
  background: var(--app-surface-solid) !important;
  box-shadow: var(--app-shadow-soft) !important;
}

body.ws-workstation-page .app-table-actions:empty {
  display: none !important;
}

body.ws-workstation-page .app-table-controls {
  width: 100% !important;
  justify-content: flex-end !important;
  margin-left: 0 !important;
}

body.ws-workstation-page .app-table-search {
  width: min(100%, 280px) !important;
}

body.ws-workstation-page .app-table-wrap,
body.ws-workstation-page .table-responsive {
  max-height: none !important;
  min-height: 0 !important;
  overflow: auto !important;
}

body.ws-workstation-page #ordersTab .app-table-wrap,
body.ws-workstation-page #ordersTab #tableView,
body.ws-workstation-page #dtTableView {
  height: auto !important;
  flex: 1 1 auto !important;
}

body.ws-workstation-page #ordersTab,
body.ws-workstation-page #downtimeTab,
body.ws-workstation-page #kpiTab {
  overflow: hidden !important;
}

body.ws-workstation-page #downtimeMain {
  height: 100% !important;
  overflow: hidden !important;
}

body.ws-workstation-page #dtTableView {
  min-height: 180px !important;
}

body.ws-workstation-page #kpiTab .card {
  margin-bottom: 12px !important;
}

body.ws-workstation-page #kpiTab canvas:not(#gAvail):not(#gPerf):not(#gQual):not(#gOee):not(#timePie) {
  max-height: 220px !important;
}

body.ws-workstation-page .status-chip-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.asset-order-metrics {
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
}

.asset-order-metrics .metric-box {
  min-height: 42px;
  padding: 6px 9px;
  border-radius: 8px;
}

.asset-order-metrics .metric-box-wide {
  grid-column: 1 / -1;
}

.asset-order-metrics .metric-value {
  font-size: 0.8rem;
  line-height: 1.15;
}

.asset-order-metrics .metric-label {
  margin-bottom: 2px;
  font-size: 0.62rem;
}

.asset-order-metrics .metric-uom {
  color: var(--app-muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.asset-gauge-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  gap: 10px;
}

.asset-mini-gauge {
  display: grid;
  justify-items: center;
  gap: 1px;
  min-width: 82px;
}

.asset-mini-gauge-title {
  color: var(--app-muted);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.order-progress-track {
  position: relative;
  overflow: visible !important;
  border-radius: 999px !important;
}

.order-progress-track > .progress-bar {
  border-radius: inherit !important;
  background: linear-gradient(90deg, #22c55e, #16a34a) !important;
  box-shadow: none !important;
}

.production-target-marker {
  position: absolute;
  top: -8px;
  left: 1%;
  z-index: 8;
  width: 12px;
  height: 7px;
  opacity: 0;
  transform: translateX(-50%);
  transition: left 0.22s ease, opacity 0.18s ease;
  pointer-events: none;
}

.production-target-marker::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1px;
  width: 0;
  height: 0;
  border-right: 5px solid transparent;
  border-left: 5px solid transparent;
  border-top: 6px solid var(--app-primary-color, #794bff);
}

.production-target-marker.is-visible {
  opacity: 1;
}

body.ws-workstation-page .order-card .progress.order-progress-track {
  overflow: visible !important;
}

body.ws-workstation-page .ws-order-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ws-favorite-toggle {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: rgba(15, 23, 42, 0.66);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.ws-favorite-toggle:hover,
.ws-favorite-toggle:focus {
  color: #111827;
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.38);
}

.ws-favorite-toggle.is-active {
  color: #111827;
  background: #ffffff;
}

.ws-favorite-toggle.is-active .fa-thumbtack {
  transform: rotate(45deg);
}

@media (max-width: 991.98px) {
  body.ws-workstation-page.has-app-sidebar main.ws-page {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  body.ws-workstation-page .sticky-desktop,
  body.ws-workstation-page .ws-left-fixed,
  body.ws-workstation-page .ws-right-stack,
  body.ws-workstation-page .tab-panel-card,
  body.ws-workstation-page .tab-panel-card .tab-content,
  body.ws-workstation-page .tab-panel-card .tab-pane.show.active,
  body.ws-workstation-page .tab-scroll-area {
    height: auto !important;
  }

  body.ws-workstation-page .order-card {
    max-height: none !important;
  }
}

/* Order scheduler final layout guards */
body.has-app-sidebar main.scheduler-page-wrap {
  box-sizing: border-box !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-toolbar {
  flex: 0 0 auto !important;
  max-height: 190px !important;
  overflow: visible !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-toolbar .card-body {
  padding: 12px 14px !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-toolbar-row {
  align-items: end !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-status-filter .status-inline-wrap {
  max-height: 74px !important;
  overflow: auto !important;
  padding-right: 4px;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-status-filter .form-check {
  min-height: 30px !important;
  margin-bottom: 4px !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-layout {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-board-card,
body.has-app-sidebar main.scheduler-page-wrap .scheduler-board-card .card-body,
body.has-app-sidebar main.scheduler-page-wrap .scheduler-scroll {
  min-height: 0 !important;
  height: 100% !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-scroll {
  overflow: auto !important;
}

body.has-app-sidebar main.scheduler-page-wrap .btn-group-toggle input[type="radio"],
body.has-app-sidebar main.scheduler-page-wrap .btn-group-toggle input[type="checkbox"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 1px !important;
  max-width: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (max-width: 1199.98px) {
  body.has-app-sidebar main.scheduler-page-wrap {
    height: auto !important;
    max-height: none !important;
    min-height: calc(100dvh - var(--app-topbar-h, 72px)) !important;
    overflow: visible !important;
  }

  body.has-app-sidebar main.scheduler-page-wrap .scheduler-toolbar {
    max-height: none !important;
  }

  body.has-app-sidebar main.scheduler-page-wrap .scheduler-status-filter .status-inline-wrap {
    max-height: none !important;
  }
}

/* Stable workstation/scheduler viewport model */
body.has-app-sidebar main.scheduler-page-wrap {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.has-app-sidebar main.scheduler-page-wrap > h4,
body.has-app-sidebar main.scheduler-page-wrap > .scheduler-page-header {
  flex: 0 0 auto !important;
  line-height: 1.2 !important;
}

body.has-app-sidebar main.scheduler-page-wrap > .scheduler-toolbar {
  flex: 0 0 auto !important;
  max-height: 132px !important;
  padding: 12px 14px !important;
  overflow: hidden !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-toolbar-row {
  display: grid !important;
  grid-template-columns: minmax(260px, max-content) minmax(260px, 380px) minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: end !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-primary-tools {
  min-width: 0 !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-status-filter {
  min-width: 0 !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-status-filter .status-inline-wrap {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(132px, max-content)) !important;
  align-items: center !important;
  gap: 8px 10px !important;
  max-height: 68px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-status-filter .form-check {
  display: inline-flex !important;
  width: max-content !important;
  min-height: 28px !important;
  margin: 0 !important;
  gap: 8px !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-layout {
  flex: 1 1 0 !important;
  min-height: 320px !important;
  overflow: hidden !important;
  display: flex !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-board-card {
  flex: 1 1 auto !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-board-card .card-header {
  min-height: 54px !important;
  padding: 10px 14px !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-board-card .card-header .mb-2 {
  margin-bottom: 0 !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-board-card .card-body {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  height: auto !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-scroll {
  height: 100% !important;
  min-height: 0 !important;
  overflow: auto !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-editor-card.is-open {
  display: flex !important;
}

body.ws-workstation-page.has-app-sidebar main.ws-page {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.ws-workstation-page .ws-page-shell {
  flex: 1 1 0 !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
}

body.ws-workstation-page .ws-breadcrumb-wrap,
body.ws-workstation-page .filters-shell,
body.ws-workstation-page .segment-tabs-wrap {
  flex: 0 0 auto !important;
}

body.ws-workstation-page .ws-layout-row {
  flex: 1 1 0 !important;
  min-height: 0 !important;
}

body.ws-workstation-page .ws-col-left,
body.ws-workstation-page .ws-col-right {
  height: 100% !important;
  min-height: 0 !important;
}

body.ws-workstation-page .sticky-desktop,
body.ws-workstation-page .ws-left-fixed,
body.ws-workstation-page .ws-right-stack {
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.ws-workstation-page .ws-left-fixed {
  display: flex !important;
  flex-direction: column !important;
}

body.ws-workstation-page .order-card {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  max-height: none !important;
}

body.ws-workstation-page .po-actions-card {
  flex: 0 0 auto !important;
}

body.ws-workstation-page .ws-right-stack {
  display: flex !important;
  flex-direction: column !important;
}

body.ws-workstation-page .tab-shell {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.ws-workstation-page .tab-panel-card {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.ws-workstation-page .tab-panel-card,
body.ws-workstation-page .tab-panel-card .tab-content,
body.ws-workstation-page .tab-panel-card .tab-pane.show.active {
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.ws-workstation-page #ordersTab .tab-scroll-area,
body.ws-workstation-page #downtimeTab .tab-scroll-area,
body.ws-workstation-page #tasksTab .tab-scroll-area,
body.ws-workstation-page #materialsTab .tab-scroll-area,
body.ws-workstation-page #feedTab .tab-scroll-area {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  background: transparent !important;
}

body.ws-workstation-page #kpiTab .tab-scroll-area {
  height: 100% !important;
  min-height: 0 !important;
  overflow: auto !important;
  padding: 0 !important;
  background: transparent !important;
}

body.ws-workstation-page #ordersTab .app-table-tools,
body.ws-workstation-page #downtimeTab .app-table-tools,
body.ws-workstation-page #downtimeMain > .local-tools {
  flex: 0 0 auto !important;
}

body.ws-workstation-page #ordersTab #tableView,
body.ws-workstation-page #ordersTab .app-table-wrap,
body.ws-workstation-page #dtTableView,
body.ws-workstation-page #dtTableView.app-table-wrap {
  flex: 1 1 0 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: auto !important;
}

body.ws-workstation-page #downtimeMain {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.ws-workstation-page .app-table-wrap {
  padding: 14px !important;
}

@media (max-width: 1199.98px) {
  body.has-app-sidebar main.scheduler-page-wrap .scheduler-toolbar-row {
    grid-template-columns: 1fr 1fr !important;
  }

  body.has-app-sidebar main.scheduler-page-wrap .scheduler-status-filter {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 991.98px) {
  body.has-app-sidebar main.scheduler-page-wrap,
  body.ws-workstation-page.has-app-sidebar main.ws-page {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  body.has-app-sidebar main.scheduler-page-wrap > .scheduler-toolbar {
    max-height: none !important;
  }

  body.ws-workstation-page .ws-col-left,
  body.ws-workstation-page .ws-col-right,
  body.ws-workstation-page .sticky-desktop,
  body.ws-workstation-page .ws-left-fixed,
  body.ws-workstation-page .ws-right-stack,
  body.ws-workstation-page .tab-panel-card,
  body.ws-workstation-page .tab-panel-card .tab-content,
  body.ws-workstation-page .tab-panel-card .tab-pane.show.active,
  body.ws-workstation-page #ordersTab .tab-scroll-area,
  body.ws-workstation-page #downtimeTab .tab-scroll-area,
  body.ws-workstation-page #kpiTab .tab-scroll-area {
    height: auto !important;
    overflow: visible !important;
  }
}

/* Scheduler inline editor layout */
body.has-app-sidebar main.scheduler-page-wrap .scheduler-page-header {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  margin: 0 0 16px !important;
  text-align: left !important;
  width: 100% !important;
}

body.has-app-sidebar main.scheduler-page-wrap .app-page-heading-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-page-header h1,
body.has-app-sidebar main.scheduler-page-wrap .scheduler-page-header h4 {
  margin: 0 !important;
  color: var(--app-text) !important;
  font-size: clamp(1.35rem, 2vw, 1.9rem) !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
}

body.has-app-sidebar main.scheduler-page-wrap > .scheduler-toolbar {
  border-radius: 18px !important;
  background: var(--app-surface-solid) !important;
  box-shadow: var(--app-shadow) !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 0 !important;
  gap: 0 !important;
  transition: grid-template-columns 0.24s ease, gap 0.24s ease !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-layout.is-editor-open {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 390px) !important;
  gap: 14px !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-editor-card {
  position: relative !important;
  inset: auto !important;
  z-index: 1 !important;
  width: auto !important;
  min-width: 0 !important;
  height: 100% !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateX(18px) !important;
  transition: opacity 0.2s ease, transform 0.24s ease !important;
  box-shadow: var(--app-shadow) !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-editor-card.is-open {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateX(0) !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-editor-body {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-editor-body form {
  min-height: 0 !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-toolbar-row {
  grid-template-columns: minmax(260px, max-content) minmax(260px, 420px) minmax(0, 1fr) !important;
}

@media (max-width: 1199.98px) {
  body.has-app-sidebar main.scheduler-page-wrap .scheduler-layout,
  body.has-app-sidebar main.scheduler-page-wrap .scheduler-layout.is-editor-open {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
  }

  body.has-app-sidebar main.scheduler-page-wrap .scheduler-editor-card {
    height: auto !important;
    max-height: 70dvh !important;
  }
}

/* Workstation left rail, order card and action card */
body.ws-workstation-page .ws-left-fixed {
  display: grid !important;
  grid-template-rows: minmax(340px, 1fr) auto !important;
  gap: 12px !important;
  height: 100% !important;
  min-height: 0 !important;
}

body.ws-workstation-page .order-card {
  grid-row: 1 !important;
  min-height: 340px !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

body.ws-workstation-page .order-card .asset-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  min-height: 64px !important;
  padding: 14px 16px !important;
}

body.ws-workstation-page .order-card .card-body {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow: auto !important;
}

body.ws-workstation-page .po-actions-card {
  grid-row: 2 !important;
  margin: 0 !important;
}

body.ws-workstation-page .po-actions-grid .btn {
  width: 100% !important;
  min-height: 50px !important;
}

@media (max-width: 991.98px) {
  body.ws-workstation-page .ws-left-fixed {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
  }

  body.ws-workstation-page .order-card {
    height: auto !important;
    min-height: 260px !important;
  }
}

/* Scheduler and workstation polish */
body.has-app-sidebar main.scheduler-page-wrap {
  gap: 14px !important;
}

body.has-app-sidebar main.scheduler-page-wrap > .scheduler-toolbar {
  max-height: none !important;
  overflow: visible !important;
  padding: 14px 16px !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-toolbar-row {
  grid-template-columns: minmax(280px, max-content) minmax(260px, 420px) minmax(360px, 1fr) !important;
  align-items: center !important;
  gap: 14px 18px !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-primary-tools {
  align-items: center !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-status-filter {
  align-self: stretch !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-status-filter > label {
  margin: 0 0 6px !important;
  color: var(--app-muted) !important;
  font-size: 0.82rem !important;
  font-weight: 800 !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-status-filter .status-inline-wrap {
  grid-template-columns: repeat(3, minmax(120px, max-content)) !important;
  gap: 8px 14px !important;
  max-height: none !important;
  overflow: visible !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-status-filter .form-check {
  align-items: center !important;
  min-height: 30px !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-status-filter .form-check-label {
  margin-bottom: 0 !important;
  font-size: 0.9rem !important;
  line-height: 1 !important;
}

.order-block {
  height: 74px !important;
  padding: 7px 9px 8px !important;
  overflow: hidden !important;
  border-radius: 13px !important;
}

.order-block.instance-order {
  background: #0f766e !important;
}

.order-block.standard-order {
  background: #2563eb !important;
}

.order-block .order-title,
.order-block .order-subtitle {
  line-height: 1.14 !important;
}

.order-block .order-title {
  font-size: 0.76rem !important;
}

.order-block .order-subtitle {
  font-size: 0.68rem !important;
  margin-top: 2px !important;
}

.order-status-badge {
  display: inline-flex !important;
  align-items: center !important;
  max-width: 100% !important;
  min-height: 17px !important;
  margin-top: 3px !important;
  padding: 3px 7px !important;
  border-radius: 999px !important;
  font-size: 0.56rem !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-board-card {
  overflow: hidden !important;
}

@media (max-width: 1399.98px) {
  body.has-app-sidebar main.scheduler-page-wrap .scheduler-toolbar-row {
    grid-template-columns: minmax(260px, max-content) minmax(240px, 380px) minmax(300px, 1fr) !important;
  }

  body.has-app-sidebar main.scheduler-page-wrap .scheduler-status-filter .status-inline-wrap {
    grid-template-columns: repeat(2, minmax(120px, max-content)) !important;
  }
}

@media (max-width: 1199.98px) {
  body.has-app-sidebar main.scheduler-page-wrap .scheduler-toolbar-row {
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
  }

  body.has-app-sidebar main.scheduler-page-wrap .scheduler-primary-tools {
    justify-content: space-between !important;
  }

  body.has-app-sidebar main.scheduler-page-wrap .scheduler-status-filter .status-inline-wrap {
    grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)) !important;
  }

  body.has-app-sidebar main.scheduler-page-wrap .scheduler-board-card {
    min-height: clamp(440px, 64dvh, 720px) !important;
  }
}

@media (max-width: 767.98px) {
  body.has-app-sidebar main.scheduler-page-wrap {
    gap: 10px !important;
  }

  body.has-app-sidebar main.scheduler-page-wrap .scheduler-page-header h1,
  body.has-app-sidebar main.scheduler-page-wrap .scheduler-page-header h4 {
    font-size: 1.35rem !important;
  }

  body.has-app-sidebar main.scheduler-page-wrap .scheduler-primary-tools {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  body.has-app-sidebar main.scheduler-page-wrap .scheduler-view-toggle,
  body.has-app-sidebar main.scheduler-page-wrap .scheduler-nav {
    width: 100% !important;
    justify-content: center !important;
  }

  body.has-app-sidebar main.scheduler-page-wrap .scheduler-status-filter .status-inline-wrap {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.has-app-sidebar main.scheduler-page-wrap .scheduler-grid {
    min-width: 820px !important;
  }

  body.has-app-sidebar main.scheduler-page-wrap .scheduler-editor-card {
    max-height: 72dvh !important;
  }
}

.segment-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 28px !important;
  height: 22px !important;
  margin-left: 8px !important;
  padding: 0 8px !important;
  border-radius: 999px !important;
  background: #ffe08a !important;
  color: #6b4e00 !important;
  font-size: 0.74rem !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  box-shadow: inset 0 0 0 1px rgba(107, 78, 0, 0.12) !important;
}

body.ws-workstation-page .local-tools-toggle {
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease !important;
}

body.ws-workstation-page .local-tools-toggle:hover {
  transform: translateY(-1px) !important;
}

body.ws-workstation-page .local-tools-toggle .chevron,
body.ws-workstation-page .local-tools-toggle i:first-child {
  transition: transform 0.2s ease !important;
}

body.ws-workstation-page .local-tools-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg) !important;
}

body.ws-workstation-page .local-tools-toggle[aria-expanded="true"] i:first-child {
  transform: scale(1.08) !important;
}

body.ws-workstation-page #downtimeMain {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow: auto !important;
  padding: 0 !important;
}

body.ws-workstation-page #downtimeTab .tab-scroll-area {
  overflow: auto !important;
}

body.ws-workstation-page #downtimeMain .local-tools {
  flex: 0 0 auto !important;
}

body.ws-workstation-page #downtimeMain .local-tools-panel {
  display: block !important;
  max-height: 0 !important;
  margin-top: 0 !important;
  padding: 0 14px !important;
  opacity: 0 !important;
  overflow: hidden !important;
  transform: translateY(-4px) !important;
  transition: max-height 0.24s ease, opacity 0.18s ease, transform 0.2s ease, padding 0.2s ease, margin 0.2s ease !important;
}

body.ws-workstation-page #downtimeMain .local-tools-panel.open {
  max-height: 190px !important;
  margin-top: 10px !important;
  padding: 14px !important;
  opacity: 1 !important;
  transform: translateY(0) !important;
}

body.ws-workstation-page #downtimeMain #dtTimelineCollapse.open {
  max-height: 255px !important;
}

body.ws-workstation-page #dtTimelineContainer {
  min-height: 0 !important;
}

body.ws-workstation-page #dtTimeline {
  height: clamp(145px, 19dvh, 205px) !important;
  min-height: 145px !important;
  max-height: 205px !important;
}

body.ws-workstation-page #dtTimeline .vis-timeline {
  height: 100% !important;
}

body.ws-workstation-page #dtTableView,
body.ws-workstation-page #dtTableView.app-table-wrap {
  flex: 1 1 auto !important;
  min-height: 240px !important;
  max-height: min(52dvh, 560px) !important;
  overflow: auto !important;
}

body.ws-workstation-page .order-card .asset-header {
  min-height: 56px !important;
  padding: 12px 14px !important;
}

body.ws-workstation-page .order-card .order-title {
  min-width: 0 !important;
  font-size: 0.96rem !important;
  line-height: 1.18 !important;
}

body.ws-workstation-page .order-card .card-body {
  padding: 13px 14px !important;
  scrollbar-width: thin !important;
}

body.ws-workstation-page .order-card .badge-order {
  margin-bottom: 10px !important;
  font-size: 0.78rem !important;
  padding: 6px 10px !important;
}

body.ws-workstation-page .order-card .order-meta-row {
  gap: 7px !important;
  font-size: 0.9rem !important;
  line-height: 1.25 !important;
}

body.ws-workstation-page .order-card .metrics-grid,
body.ws-workstation-page .order-card .dates-grid {
  gap: 8px !important;
}

body.ws-workstation-page .order-card .metric-box,
body.ws-workstation-page .order-card .date-box {
  padding: 9px 10px !important;
}

body.ws-workstation-page .order-card .metric-label {
  font-size: 0.68rem !important;
}

body.ws-workstation-page .order-card .metric-value {
  font-size: 0.98rem !important;
  line-height: 1.18 !important;
}

body.ws-workstation-page .order-card .progress {
  height: 10px !important;
  margin: 8px 0 !important;
}

body.ws-workstation-page .po-actions-card .card-body {
  padding: 12px !important;
}

body.ws-workstation-page .po-actions-grid {
  gap: 10px !important;
}

body.ws-workstation-page .po-actions-grid .btn {
  min-height: 46px !important;
  font-size: 0.94rem !important;
}

@media (max-width: 991.98px) {
  body.ws-workstation-page #downtimeMain,
  body.ws-workstation-page #downtimeTab .tab-scroll-area {
    overflow: visible !important;
  }

  body.ws-workstation-page #dtTableView,
  body.ws-workstation-page #dtTableView.app-table-wrap {
    max-height: 62dvh !important;
  }

  body.ws-workstation-page #downtimeMain .local-tools-panel.open,
  body.ws-workstation-page #downtimeMain #dtTimelineCollapse.open {
    max-height: none !important;
  }
}

/* Scheduler tablet/mobile and workstation final spacing */
body.has-app-sidebar main.scheduler-page-wrap .scheduler-page-header h1,
body.has-app-sidebar main.scheduler-page-wrap .scheduler-page-header h4 {
  font-size: clamp(1.15rem, 1.35vw, 1.55rem) !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-layout {
  min-height: 0 !important;
  padding-bottom: 2px !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-board-card,
body.has-app-sidebar main.scheduler-page-wrap .scheduler-editor-card {
  border: 1px solid var(--app-border) !important;
  border-radius: 18px !important;
  background: var(--app-surface-solid) !important;
  overflow: hidden !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-board-card {
  box-shadow: var(--app-shadow) !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-scroll {
  padding: 14px !important;
}

@media (max-width: 1199.98px) {
  body.has-app-sidebar main.scheduler-page-wrap .scheduler-layout,
  body.has-app-sidebar main.scheduler-page-wrap .scheduler-layout.is-editor-open {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    overflow: visible !important;
  }

  body.has-app-sidebar main.scheduler-page-wrap .scheduler-layout:not(.is-editor-open) .scheduler-editor-card {
    display: none !important;
  }

  body.has-app-sidebar main.scheduler-page-wrap .scheduler-layout.is-editor-open .scheduler-board-card {
    flex: 0 0 auto !important;
    min-height: clamp(340px, 45dvh, 520px) !important;
    height: clamp(340px, 45dvh, 520px) !important;
  }

  body.has-app-sidebar main.scheduler-page-wrap .scheduler-layout:not(.is-editor-open) .scheduler-board-card {
    min-height: clamp(460px, 68dvh, 720px) !important;
  }

  body.has-app-sidebar main.scheduler-page-wrap .scheduler-layout.is-editor-open .scheduler-editor-card {
    display: flex !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    height: auto !important;
    max-height: 54dvh !important;
    min-height: 300px !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: none !important;
  }

  body.has-app-sidebar main.scheduler-page-wrap .scheduler-editor-body {
    max-height: calc(54dvh - 58px) !important;
    overflow-y: auto !important;
  }
}

@media (max-width: 767.98px) {
  body.has-app-sidebar main.scheduler-page-wrap .scheduler-layout.is-editor-open .scheduler-board-card {
    min-height: 340px !important;
    height: 340px !important;
  }

  body.has-app-sidebar main.scheduler-page-wrap .scheduler-layout.is-editor-open .scheduler-editor-card {
    max-height: 66dvh !important;
  }

  body.has-app-sidebar main.scheduler-page-wrap .scheduler-editor-body {
    max-height: calc(66dvh - 58px) !important;
  }
}

body.ws-workstation-page .order-card .card-body {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-evenly !important;
  gap: clamp(10px, 1.4dvh, 20px) !important;
  padding: clamp(14px, 1.5dvh, 22px) 14px !important;
}

body.ws-workstation-page .order-card .order-meta-row {
  display: grid !important;
  gap: clamp(7px, 1dvh, 12px) !important;
}

body.ws-workstation-page .order-card .metrics-grid,
body.ws-workstation-page .order-card .dates-grid {
  gap: clamp(8px, 1dvh, 12px) !important;
}

body.ws-workstation-page .order-card .metric-box,
body.ws-workstation-page .order-card .date-box {
  min-height: clamp(64px, 7.8dvh, 92px) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}

body.ws-workstation-page .order-card .progress {
  height: 16px !important;
  margin: clamp(6px, 1dvh, 12px) 0 !important;
  border-radius: 999px !important;
  background: rgba(15, 23, 42, 0.08) !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08) !important;
  overflow: hidden !important;
}

body.ws-workstation-page .order-card .progress-bar {
  border-radius: 999px !important;
  font-size: 0.72rem !important;
  font-weight: 900 !important;
  line-height: 16px !important;
}

@media (max-width: 991.98px) {
  body.ws-workstation-page .order-card .card-body {
    justify-content: flex-start !important;
  }

  body.ws-workstation-page .order-card .metric-box,
  body.ws-workstation-page .order-card .date-box {
    min-height: 64px !important;
  }
}

body.ws-workstation-page .dt-toolbar-search {
  width: min(360px, 34vw) !important;
  min-width: 220px !important;
}

body.ws-workstation-page .dt-toolbar-search .form-control {
  min-height: 42px !important;
  border-radius: 999px !important;
  padding-left: 16px !important;
}

body.ws-workstation-page #downtimeMain .local-toolbar {
  align-items: center !important;
}

body.ws-workstation-page #downtimeMain .local-toolbar-right {
  flex: 1 1 auto !important;
  justify-content: flex-end !important;
}

body.ws-workstation-page #downtimeMain .local-tools-panel.open {
  max-height: 160px !important;
}

body.ws-workstation-page #downtimeMain #dtTimelineCollapse.open {
  max-height: 218px !important;
}

body.ws-workstation-page #dtTimeline {
  height: clamp(118px, 15dvh, 168px) !important;
  min-height: 118px !important;
  max-height: 168px !important;
}

body.ws-workstation-page #dtTimelineContainer .d-flex.justify-content-between {
  margin-bottom: 6px !important;
}

body.ws-workstation-page #dtResetZoomBtn {
  min-height: 34px !important;
  padding: 0.28rem 0.65rem !important;
}

@media (max-width: 767.98px) {
  body.ws-workstation-page .local-toolbar-left,
  body.ws-workstation-page .local-toolbar-right,
  body.ws-workstation-page .dt-toolbar-search {
    width: 100% !important;
    min-width: 0 !important;
  }

  body.ws-workstation-page #dtAssignMultipleBtn {
    width: 100% !important;
  }

  body.ws-workstation-page #downtimeMain .local-tools-panel.open,
  body.ws-workstation-page #downtimeMain #dtTimelineCollapse.open {
    max-height: none !important;
  }
}

body.ws-workstation-page #kpiTab .tab-scroll-area {
  padding: 0 !important;
}

body.ws-workstation-page #kpiTab .kpi-card {
  border: 1px solid var(--app-border) !important;
  border-radius: 18px !important;
  background: var(--app-surface-solid) !important;
  box-shadow: var(--app-shadow-soft) !important;
  overflow: hidden !important;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease !important;
}

body.ws-workstation-page #kpiTab .kpi-chart-card:hover,
body.ws-workstation-page #kpiTab .kpi-summary-card:hover {
  border-color: var(--app-border) !important;
  box-shadow: none !important;
  transform: none !important;
}

body.ws-workstation-page #kpiTab .kpi-card .card-header {
  min-height: 44px !important;
  padding: 10px 14px !important;
  border-bottom: 1px solid var(--app-border) !important;
  background: rgba(248, 250, 252, 0.72) !important;
}

body.ws-workstation-page #kpiTab .kpi-gauge-card .card-body {
  padding: 12px 14px !important;
}

body.ws-workstation-page #kpiTab .kpi-gauge-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 10px !important;
  align-items: center !important;
}

body.ws-workstation-page #kpiTab .kpi-gauge-item {
  min-height: 112px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  border: 1px solid rgba(226, 232, 240, 0.8) !important;
  border-radius: 14px !important;
  background: #ffffff !important;
}

body.ws-workstation-page #kpiTab .kpi-gauge-label {
  color: var(--app-muted) !important;
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  text-align: center !important;
}

body.ws-workstation-page #kpiTab .kpi-gauge-canvas {
  width: 78px !important;
  height: 78px !important;
}

body.ws-workstation-page #kpiTab .kpi-chart-body {
  height: clamp(190px, 24dvh, 260px) !important;
  padding: 12px !important;
  display: flex !important;
  align-items: center !important;
}

body.ws-workstation-page #kpiTab .kpi-summary-body {
  min-height: clamp(190px, 24dvh, 260px) !important;
  padding: 12px !important;
  display: flex !important;
  align-items: center !important;
}

body.ws-workstation-page #kpiTab .kpi-timepie-canvas {
  width: 126px !important;
  height: 126px !important;
  margin: 0 auto !important;
}

body.ws-workstation-page #kpiTab #timePie {
  max-width: 126px !important;
  max-height: 126px !important;
}

body.ws-workstation-page #kpiTab canvas:not(#gAvail):not(#gPerf):not(#gQual):not(#gOee):not(#timePie) {
  max-height: 220px !important;
}

@media (max-width: 991.98px) {
  body.ws-workstation-page #kpiTab .kpi-gauge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.ws-workstation-page #kpiTab .kpi-chart-body,
  body.ws-workstation-page #kpiTab .kpi-summary-body {
    height: auto !important;
    min-height: 220px !important;
  }
}

/* Workstation final card/search/KPI corrections */
body.ws-workstation-page .order-card .card-body {
  align-items: stretch !important;
  justify-content: space-between !important;
  gap: clamp(12px, 1.8dvh, 24px) !important;
}

body.ws-workstation-page .order-card #statusBadge,
body.ws-workstation-page .order-card .badge-order#statusBadge {
  align-self: flex-start !important;
  width: auto !important;
  max-width: 100% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 7px 12px !important;
  border-radius: 999px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

body.ws-workstation-page .order-card .progress {
  width: 100% !important;
  height: 22px !important;
  min-height: 22px !important;
  margin: clamp(8px, 1.4dvh, 16px) 0 !important;
  border-radius: 999px !important;
  background: #e5e7eb !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.1) !important;
}

body.ws-workstation-page .order-card .progress-bar {
  min-width: 28px !important;
  height: 100% !important;
  border-radius: 999px !important;
  font-size: 0.78rem !important;
  line-height: 22px !important;
  background: linear-gradient(90deg, #22c55e, #16a34a) !important;
  box-shadow: none !important;
}

body.ws-workstation-page .order-card .metrics-grid,
body.ws-workstation-page .order-card .dates-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

body.ws-workstation-page .order-card .metric-box,
body.ws-workstation-page .order-card .date-box {
  min-height: clamp(74px, 8.6dvh, 104px) !important;
  border-radius: 16px !important;
}

@media (min-width: 1400px) {
  body.ws-workstation-page .order-card .card-body {
    padding-top: clamp(18px, 2.2dvh, 30px) !important;
    padding-bottom: clamp(18px, 2.2dvh, 30px) !important;
  }

  body.ws-workstation-page .order-card .metric-box,
  body.ws-workstation-page .order-card .date-box {
    min-height: clamp(84px, 9.2dvh, 116px) !important;
  }
}

@media (max-width: 991.98px) {
  body.ws-workstation-page .order-card .card-body {
    justify-content: flex-start !important;
  }

  body.ws-workstation-page .order-card .progress {
    height: 18px !important;
    min-height: 18px !important;
  }

  body.ws-workstation-page .order-card .progress-bar {
    line-height: 18px !important;
  }
}

body.ws-workstation-page #downtimeMain .compact-filter-row {
  align-items: end !important;
}

body.ws-workstation-page #downtimeMain #dtSearchInput {
  min-height: 42px !important;
  border-radius: 999px !important;
  padding-left: 16px !important;
}

.downtime-action-modal .modal-content {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 26px;
  background: var(--app-surface-solid);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.downtime-action-modal .modal-header,
.downtime-action-modal .modal-footer {
  border-color: rgba(148, 163, 184, 0.18);
}

.downtime-action-modal .modal-body {
  max-height: min(72dvh, 720px);
  overflow: auto;
}

.dt-assign-summary,
.dt-assign-footer-grid,
.dt-split-selected-grid,
.dt-split-range-meta {
  display: grid;
  gap: 12px;
}

.dt-assign-summary {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin-bottom: 14px;
}

.dt-reason-level {
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.72);
}

.dt-reason-level + .dt-reason-level {
  margin-top: 10px;
}

.dt-reason-level-title {
  margin-bottom: 8px;
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dt-reason-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.dt-reason-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--app-text);
  padding: 9px 11px;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.dt-reason-option:hover {
  border-color: color-mix(in srgb, var(--app-primary-color, #794bff) 34%, transparent);
  background: color-mix(in srgb, var(--app-primary-color, #794bff) 8%, transparent);
  transform: translateY(-1px);
}

.dt-reason-option.active {
  border-color: color-mix(in srgb, var(--app-primary-color, #794bff) 42%, transparent);
  background: color-mix(in srgb, var(--app-primary-color, #794bff) 14%, transparent);
}

.dt-reason-option strong,
.dt-reason-option small {
  display: block;
}

.dt-reason-option small,
.dt-reason-option em {
  color: var(--app-muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
}

.dt-assign-footer-grid {
  grid-template-columns: minmax(0, 1.3fr) minmax(220px, 0.7fr);
  margin-top: 14px;
}

.dt-assign-footer-grid textarea {
  min-height: 88px;
  resize: vertical;
}

.dt-selected-reason-card,
.dt-split-event-chip {
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.78);
}

.dt-selected-reason-card strong,
.dt-split-event-chip strong {
  display: block;
  margin-top: 4px;
  color: var(--app-text);
  overflow-wrap: anywhere;
}

.dt-split-card {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 22px;
  background: rgba(248, 250, 252, 0.74);
}

.dt-split-range-meta,
.dt-split-selected-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dt-split-range-meta {
  margin-bottom: 14px;
}

.dt-split-range-meta span,
.dt-split-selected-grid > div {
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
}

.dt-split-range-meta small,
.dt-split-selected-grid small {
  display: block;
  color: var(--app-muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dt-split-range-meta strong,
.dt-split-selected-grid strong {
  display: block;
  margin-top: 3px;
}

.dt-split-label {
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dt-split-slider {
  width: 100%;
  height: 18px;
  accent-color: var(--app-teal, var(--app-primary-color, #794bff));
  cursor: pointer;
}

.dt-split-slider::-webkit-slider-thumb {
  width: 30px;
  height: 30px;
  border: 3px solid #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.22);
}

.dt-split-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border: 3px solid #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.22);
}

.dt-class-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 4px;
  border-radius: 999px;
  padding: 0.35rem 0.55rem;
}

body.ws-workstation-page #dtTimelineContainer,
body.ws-workstation-page #dtTimelineContainer .vis-panel,
body.ws-workstation-page #dtTimelineContainer .vis-timeline,
body.ws-workstation-page #dtTimeline {
  overflow: visible !important;
}

body.ws-workstation-page #dtNoTimelineMessage:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.ws-workstation-page #downtimeMain #dtTimelineCollapse.open {
  max-height: min(32dvh, 320px) !important;
  overflow: visible !important;
}

body.ws-workstation-page #dtTimeline {
  height: clamp(150px, 20dvh, 220px) !important;
  min-height: 150px !important;
  max-height: 220px !important;
  padding-bottom: 6px;
}

body.ws-workstation-page #dtTimeline .vis-timeline {
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  border-radius: 12px !important;
  background: rgba(248, 250, 252, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body.ws-workstation-page #dtTimeline .vis-item {
  border-width: 0 !important;
  border-radius: 3px !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

body.ws-workstation-page #dtTimeline .vis-time-axis .vis-text {
  color: var(--app-muted);
  font-weight: 800;
}

body.ws-workstation-page #dtTimeline .vis-grid.vis-minor {
  border-color: rgba(148, 163, 184, 0.16);
}

body.ws-workstation-page #dtTimelineContainer {
  position: relative;
}

body.ws-workstation-page .dt-timeline-actions {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 4;
}

body.ws-workstation-page .dt-timeline-message[hidden] {
  display: none !important;
}

body.ws-workstation-page .dt-timeline-message {
  margin: 0 0 8px;
  padding: 8px 12px;
  border: 1px solid rgba(59, 130, 246, 0.16);
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.08);
  color: var(--app-muted);
  font-weight: 800;
}

body.ws-workstation-page #downtimeMain #dtTimelineCollapse.open {
  max-height: min(24dvh, 230px) !important;
  margin-top: 10px !important;
}

body.ws-workstation-page #dtTimeline {
  height: clamp(118px, 16dvh, 172px) !important;
  min-height: 118px !important;
  max-height: 172px !important;
  padding: 0 !important;
}

body.ws-workstation-page #dtTimeline .vis-timeline {
  border-radius: 14px !important;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.94)) !important;
}

body.ws-workstation-page #dtTimeline .vis-panel.vis-center,
body.ws-workstation-page #dtTimeline .vis-panel.vis-top,
body.ws-workstation-page #dtTimeline .vis-panel.vis-bottom,
body.ws-workstation-page #dtTimeline .vis-panel.vis-left,
body.ws-workstation-page #dtTimeline .vis-panel.vis-right {
  border-color: rgba(148, 163, 184, 0.14) !important;
}

body.ws-workstation-page #dtTimeline .vis-panel.vis-center {
  border-radius: 0 0 14px 14px;
}

body.ws-workstation-page #dtTimeline .vis-panel.vis-top {
  border-radius: 14px 14px 0 0;
}

body.ws-workstation-page #dtTimeline .vis-grid.vis-vertical,
body.ws-workstation-page #dtTimeline .vis-grid.vis-horizontal {
  border-color: rgba(148, 163, 184, 0.12) !important;
}

body.ws-workstation-page #dtTimeline .vis-current-time {
  width: 2px;
  background-color: color-mix(in srgb, var(--app-primary-color, #794bff) 80%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-primary-color, #794bff) 10%, transparent);
}

@media (max-width: 767.98px) {
  .dt-assign-summary,
  .dt-assign-footer-grid,
  .dt-split-range-meta,
  .dt-split-selected-grid {
    grid-template-columns: 1fr;
  }

  .dt-assign-summary .btn {
    width: 100%;
  }
}

body.ws-workstation-page #downtimeMain .local-tools-panel:not(.open) {
  max-height: 0 !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  opacity: 0 !important;
}

body.ws-workstation-page #kpiTab,
body.ws-workstation-page #kpiTab .tab-scroll-area {
  min-height: 0 !important;
  overflow: auto !important;
}

body.ws-workstation-page #kpiTab .tab-scroll-area {
  height: 100% !important;
  padding: 0 4px 8px 0 !important;
}

body.ws-workstation-page #kpiTab .kpi-card {
  margin-bottom: 12px !important;
}

body.ws-workstation-page #kpiTab .kpi-gauge-card {
  flex: 0 0 auto !important;
}

body.ws-workstation-page #kpiTab .kpi-gauge-card .card-body {
  padding: 14px !important;
}

body.ws-workstation-page #kpiTab .kpi-gauge-item {
  min-height: clamp(118px, 14dvh, 150px) !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04) !important;
}

body.ws-workstation-page #kpiTab .kpi-chart-card,
body.ws-workstation-page #kpiTab .kpi-summary-card {
  min-height: clamp(250px, 34dvh, 360px) !important;
}

body.ws-workstation-page #kpiTab .kpi-chart-body {
  height: clamp(205px, 28dvh, 300px) !important;
  min-height: 205px !important;
}

body.ws-workstation-page #kpiTab .kpi-summary-body {
  min-height: clamp(205px, 28dvh, 300px) !important;
}

body.ws-workstation-page #kpiTab .kpi-chart-body canvas {
  max-height: 100% !important;
}

@media (max-width: 767.98px) {
  body.ws-workstation-page #kpiTab .kpi-gauge-grid {
    grid-template-columns: 1fr !important;
  }

  body.ws-workstation-page #kpiTab .kpi-chart-card,
  body.ws-workstation-page #kpiTab .kpi-summary-card {
    min-height: auto !important;
  }
}

/* Workstation compact order card and KPI row layout */
body.ws-workstation-page .order-card .card-body {
  gap: clamp(9px, 1.25dvh, 15px) !important;
  padding: clamp(12px, 1.7dvh, 18px) 14px !important;
}

body.ws-workstation-page .order-card .order-progress-summary {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  margin: 0 !important;
}

body.ws-workstation-page .order-card .order-qty-line {
  display: flex !important;
  align-items: baseline !important;
  gap: 6px !important;
  color: #0f172a !important;
  font-size: clamp(1rem, 1.15vw, 1.25rem) !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;
}

body.ws-workstation-page .order-card .order-qty-line i {
  color: var(--primary-color, #0d6efd) !important;
  font-size: 0.92rem !important;
}

body.ws-workstation-page .order-card .order-secondary-line {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 7px !important;
  color: var(--app-muted, #64748b) !important;
  font-size: 0.8rem !important;
  line-height: 1.25 !important;
}

body.ws-workstation-page .order-card .order-separator {
  color: #cbd5e1 !important;
}

body.ws-workstation-page .order-card .progress {
  height: 20px !important;
  min-height: 20px !important;
  margin: 6px 0 !important;
}

body.ws-workstation-page .order-card .progress-bar {
  line-height: 20px !important;
}

body.ws-workstation-page .order-card .dates-grid.order-dates-compact {
  gap: 8px !important;
  margin-top: auto !important;
}

body.ws-workstation-page .order-card .order-dates-compact .date-box {
  min-height: 54px !important;
  padding: 8px 10px !important;
  font-size: 0.78rem !important;
  line-height: 1.25 !important;
  justify-content: center !important;
}

body.ws-workstation-page .order-card .order-dates-compact .date-box b {
  margin-bottom: 2px !important;
  font-size: 0.68rem !important;
}

body.ws-workstation-page #kpiTab .kpi-gauge-grid.row {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: stretch !important;
  margin-right: -6px !important;
  margin-left: -6px !important;
}

body.ws-workstation-page #kpiTab .kpi-gauge-grid.row > [class*="col-"] {
  display: flex !important;
  padding-right: 6px !important;
  padding-left: 6px !important;
}

body.ws-workstation-page #kpiTab .kpi-gauge-card .card-body {
  padding: 12px !important;
}

body.ws-workstation-page #kpiTab .kpi-gauge-grid.row .kpi-gauge-item {
  width: 100% !important;
  min-height: clamp(104px, 12dvh, 128px) !important;
  padding: 10px !important;
}

body.ws-workstation-page #kpiTab .kpi-gauge-canvas {
  width: 88px !important;
  height: 88px !important;
}

body.ws-workstation-page #kpiTab .kpi-gauge-canvas canvas {
  max-width: 88px !important;
  max-height: 88px !important;
}

/* Workstation PO card and KPI final sizing pass */
body.ws-workstation-page .ws-left-fixed {
  grid-template-rows: auto auto !important;
  align-content: start !important;
}

body.ws-workstation-page .order-card {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

body.ws-workstation-page .order-card .card-body {
  justify-content: flex-start !important;
  overflow: visible !important;
  gap: clamp(8px, 1.1dvh, 12px) !important;
}

body.ws-workstation-page .order-card .order-metrics-compact {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: clamp(7px, 0.9dvh, 10px) !important;
}

body.ws-workstation-page .order-card .order-metrics-compact .metric-box {
  min-height: clamp(52px, 6.2dvh, 68px) !important;
  padding: clamp(7px, 0.9dvh, 10px) !important;
  border-radius: 14px !important;
}

body.ws-workstation-page .order-card .order-metrics-compact .metric-box-wide {
  grid-column: 1 / -1 !important;
}

body.ws-workstation-page .order-card .order-metrics-compact .metric-label {
  font-size: clamp(0.62rem, 0.58vw, 0.72rem) !important;
  line-height: 1.1 !important;
  margin-bottom: 3px !important;
}

body.ws-workstation-page .order-card .order-metrics-compact .metric-value {
  font-size: clamp(0.86rem, 0.92vw, 1.05rem) !important;
  line-height: 1.15 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body.ws-workstation-page .order-card .progress {
  height: clamp(18px, 2.4dvh, 22px) !important;
  min-height: 18px !important;
  margin: 4px 0 !important;
}

body.ws-workstation-page .order-card .progress-bar {
  line-height: clamp(18px, 2.4dvh, 22px) !important;
}

body.ws-workstation-page .order-card .dates-grid.order-dates-compact {
  margin-top: 0 !important;
}

body.ws-workstation-page .order-card .order-dates-compact .date-box {
  min-height: clamp(48px, 5.5dvh, 60px) !important;
}

body.ws-workstation-page .order-card .order-dates-detailed .date-box {
  display: grid !important;
  align-content: center !important;
  gap: 1px !important;
  min-height: clamp(68px, 7.2dvh, 82px) !important;
}

body.ws-workstation-page .order-card .order-dates-detailed .date-box small {
  color: #94a3b8 !important;
  font-size: .62rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
}

body.ws-workstation-page .order-card .order-dates-detailed .date-box b {
  margin-top: 3px !important;
  color: #475569 !important;
  font-size: .66rem !important;
}

body.ws-workstation-page .order-card .order-dates-detailed .date-secondary {
  color: #64748b !important;
  font-size: .72rem !important;
  font-weight: 700 !important;
}

body.ws-workstation-page .order-card .order-dates-detailed .date-primary {
  color: #0f172a !important;
  font-size: .8rem !important;
  font-weight: 900 !important;
}

body.ws-workstation-page #kpiTab .tab-scroll-area {
  display: block !important;
  height: 100% !important;
  overflow-y: auto !important;
  padding: 0 4px 8px 0 !important;
}

body.ws-workstation-page #kpiTab .kpi-gauge-card {
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  margin-bottom: 10px !important;
}

body.ws-workstation-page #kpiTab .kpi-gauge-card .card-body {
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 10px 12px !important;
}

body.ws-workstation-page #kpiTab .kpi-gauge-grid.row {
  height: auto !important;
  min-height: 0 !important;
  align-items: stretch !important;
  gap: 0 !important;
}

body.ws-workstation-page #kpiTab .kpi-gauge-grid.row > [class*="col-"] {
  min-height: 0 !important;
}

body.ws-workstation-page #kpiTab .kpi-gauge-grid.row .kpi-gauge-item {
  min-height: 96px !important;
  height: 96px !important;
  padding: 8px !important;
  gap: 4px !important;
}

body.ws-workstation-page #kpiTab .kpi-gauge-label {
  line-height: 1.1 !important;
}

body.ws-workstation-page #kpiTab .kpi-gauge-canvas {
  width: 72px !important;
  height: 72px !important;
}

body.ws-workstation-page #kpiTab .kpi-gauge-canvas canvas,
body.ws-workstation-page #kpiTab #gAvail,
body.ws-workstation-page #kpiTab #gPerf,
body.ws-workstation-page #kpiTab #gQual,
body.ws-workstation-page #kpiTab #gOee {
  width: 72px !important;
  height: 72px !important;
  max-width: 72px !important;
  max-height: 72px !important;
}

body.ws-workstation-page #kpiTab .kpi-chart-card,
body.ws-workstation-page #kpiTab .kpi-summary-card {
  min-height: clamp(225px, 30dvh, 320px) !important;
}

body.ws-workstation-page #kpiTab .kpi-chart-body {
  height: clamp(180px, 24dvh, 260px) !important;
  min-height: 180px !important;
}

body.ws-workstation-page #kpiTab .kpi-summary-body {
  min-height: clamp(180px, 24dvh, 260px) !important;
}

@media (max-width: 991.98px) {
  body.ws-workstation-page .ws-left-fixed {
    display: flex !important;
  }

  body.ws-workstation-page #kpiTab .kpi-gauge-grid.row .kpi-gauge-item {
    height: 92px !important;
  }
}

/* Workstation PO card height recovery */
body.ws-workstation-page .ws-left-fixed {
  display: flex !important;
  flex-direction: column !important;
  align-content: stretch !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

body.ws-workstation-page .order-card {
  flex: 0 0 auto !important;
  min-height: clamp(330px, 39dvh, 420px) !important;
  height: auto !important;
  overflow: hidden !important;
}

body.ws-workstation-page .order-card .card-body {
  flex: 0 0 auto !important;
  min-height: auto !important;
  overflow: visible !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
}

body.ws-workstation-page .po-actions-card {
  flex: 0 0 auto !important;
}

body.ws-workstation-page .order-card .order-metrics-compact .metric-box {
  min-height: clamp(58px, 6.8dvh, 78px) !important;
}

body.ws-workstation-page .order-card .order-dates-compact .date-box {
  min-height: clamp(54px, 6dvh, 68px) !important;
}

@media (max-width: 1366px) {
  body.ws-workstation-page .order-card {
    min-height: 350px !important;
  }

  body.ws-workstation-page .order-card .asset-header {
    min-height: 56px !important;
  }
}

@media (max-width: 991.98px) {
  body.ws-workstation-page .ws-left-fixed {
    overflow: visible !important;
  }

  body.ws-workstation-page .order-card {
    min-height: 330px !important;
  }
}

/* Workstation final desktop split and mobile tab recovery */
@media (min-width: 992px) {
  body.ws-workstation-page .ws-left-fixed {
    display: grid !important;
    grid-template-rows: minmax(0, 7fr) minmax(96px, 3fr) !important;
    gap: 12px !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body.ws-workstation-page .order-card {
    grid-row: 1 !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
  }

  body.ws-workstation-page .order-card .card-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  body.ws-workstation-page .po-actions-card {
    grid-row: 2 !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body.ws-workstation-page .po-actions-card .card-body {
    height: 100% !important;
    min-height: 0 !important;
    padding: clamp(10px, 1.4dvh, 14px) !important;
    display: flex !important;
    align-items: center !important;
  }

  body.ws-workstation-page .po-actions-grid {
    width: 100% !important;
    height: auto !important;
    max-height: 100% !important;
    display: grid !important;
    gap: clamp(8px, 1.2dvh, 12px) !important;
    align-content: center !important;
  }

  body.ws-workstation-page .po-actions-grid .btn {
    min-height: clamp(42px, 6.2dvh, 54px) !important;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }
}

/* Workstation unified PO card with embedded actions */
body.ws-workstation-page .po-actions-card {
  display: none !important;
}

body.ws-workstation-page .order-actions-section {
  flex: 0 0 auto;
  margin-top: auto;
  padding-top: clamp(10px, 1.2dvh, 14px);
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

body.ws-workstation-page .order-actions-section .po-actions-grid {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px !important;
  align-content: stretch !important;
}

body.ws-workstation-page .ws-order-action-btn,
body.ws-workstation-page .po-actions-grid .btn {
  min-height: clamp(40px, 5.4dvh, 50px) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 0 !important;
  border-radius: 16px !important;
  font-weight: 900 !important;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08) !important;
}

@media (min-width: 992px) {
  body.ws-workstation-page .ws-left-fixed {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body.ws-workstation-page .order-card {
    flex: 1 1 auto !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body.ws-workstation-page .order-card .card-body {
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
}

@media (max-width: 767.98px) {
  body.ws-workstation-page .order-actions-section .po-actions-grid {
    grid-template-columns: 1fr;
  }

  body.ws-workstation-page .ws-task-actions {
    grid-template-columns: 1fr !important;
  }

  body.ws-workstation-page .ws-task-actions-left,
  body.ws-workstation-page .ws-task-actions-right {
    justify-content: flex-start !important;
  }

  body.ws-workstation-page .ws-task-actions .btn {
    flex: 1 1 120px;
  }
}

/* Workstation task runtime */
body.ws-workstation-page .ws-tasks-panel {
  height: 100%;
  min-height: 0;
  display: block;
}

body.ws-workstation-page .ws-tasks-layout {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(380px, 1fr);
  gap: 16px;
}

body.ws-workstation-page .ws-task-filter-panel,
body.ws-workstation-page .ws-task-list-panel {
  min-height: 0;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: var(--app-surface-solid);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

body.ws-workstation-page .ws-task-filter-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
  padding: 14px;
}

body.ws-workstation-page .ws-task-filter-header {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 12px;
}

body.ws-workstation-page .ws-task-filter-header .btn {
  flex: 0 0 auto;
  min-height: 38px;
  white-space: nowrap;
}

body.ws-workstation-page .ws-task-list-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 14px;
}

body.ws-workstation-page .ws-task-filter-stack {
  display: grid;
  gap: 12px;
}

body.ws-workstation-page .ws-task-filter-stack label {
  display: grid;
  gap: 6px;
  margin: 0;
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 900;
}

body.ws-workstation-page .ws-task-chart-card {
  display: grid;
  gap: 10px;
  margin-top: 0;
  padding: 12px 12px 14px;
  border: 1px solid var(--app-border);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.82);
  text-align: center;
}

body.ws-workstation-page .ws-task-chart-wrap {
  height: 142px;
  min-height: 132px;
}

body.ws-workstation-page .ws-task-manual-dialog {
  width: min(780px, calc(100vw - 24px));
}

body.ws-workstation-page .ws-task-manual-modal .modal-content {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 26px;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

body.ws-workstation-page .ws-task-manual-modal .modal-header,
body.ws-workstation-page .ws-task-manual-modal .modal-footer {
  border-color: rgba(148, 163, 184, 0.18);
}

body.ws-workstation-page .ws-task-manual-hint {
  margin: 0 0 12px;
  color: var(--app-muted);
  font-size: 0.9rem;
}

body.ws-workstation-page .ws-task-manual-search {
  position: relative;
  z-index: 5;
  isolation: isolate;
  margin-bottom: 12px;
  pointer-events: auto;
}

body.ws-workstation-page .ws-task-manual-search > i {
  position: absolute;
  left: 16px;
  top: 50%;
  z-index: 2;
  color: rgba(100, 116, 139, 0.72);
  font-size: 0.9rem;
  transform: translateY(-50%);
  pointer-events: none;
}

body.ws-workstation-page .ws-task-manual-search .form-control {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 46px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  color: var(--app-text);
  font-weight: 700;
  padding-left: 44px;
  padding-right: 44px;
  pointer-events: auto;
  appearance: none;
  -webkit-appearance: none;
}

body.ws-workstation-page .ws-task-manual-search .form-control:focus {
  border-color: color-mix(in srgb, var(--app-primary-color, #794bff) 42%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--app-primary-color, #794bff) 10%, transparent);
}

body.ws-workstation-page .ws-task-manual-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.9);
  color: rgba(71, 85, 105, 0.86);
  opacity: 0;
  transform: translateY(-50%) scale(0.94);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

body.ws-workstation-page .ws-task-manual-search.has-value .ws-task-manual-search-clear {
  opacity: 1;
  transform: translateY(-50%) scale(1);
  pointer-events: auto;
}

body.ws-workstation-page .ws-task-manual-search-clear:hover {
  background: rgba(203, 213, 225, 0.95);
}

.ws-task-manual-modal .modal-body {
  position: relative;
}

.ws-task-manual-modal .ws-task-manual-search {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 0;
  width: 100%;
  min-height: 46px;
  margin-bottom: 12px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  isolation: isolate;
  pointer-events: auto;
}

.ws-task-manual-modal .ws-task-manual-search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 44px;
  color: rgba(100, 116, 139, 0.72);
  font-size: 0.9rem;
  pointer-events: none;
}

.ws-task-manual-modal .ws-task-manual-search .form-control,
.ws-task-manual-modal .ws-task-manual-search-input {
  position: relative !important;
  z-index: 1 !important;
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 44px !important;
  padding: 0.55rem 4px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--app-text) !important;
  box-shadow: none !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.ws-task-manual-modal .ws-task-manual-options {
  position: relative;
  z-index: 1;
}

.ws-task-manual-modal .ws-task-manual-search-clear {
  position: static;
  width: 28px;
  height: 28px;
  margin: 0 auto;
  transform: none;
}

.ws-task-manual-modal .ws-task-manual-search.has-value .ws-task-manual-search-clear {
  transform: none;
}

body.ws-workstation-page .ws-task-manual-modal .ws-task-manual-search {
  display: grid !important;
  grid-template-columns: 34px minmax(0, 1fr) 34px !important;
  align-items: center !important;
  min-height: 46px !important;
  border: 1px solid rgba(148, 163, 184, 0.26) !important;
  background: rgba(255, 255, 255, 0.96) !important;
}

body.ws-workstation-page .ws-task-manual-modal .ws-task-manual-search-icon {
  display: inline-flex !important;
}

body.ws-workstation-page .ws-task-manual-modal .ws-task-manual-search .form-control,
body.ws-workstation-page .ws-task-manual-modal .ws-task-manual-search-input {
  display: block !important;
  width: 100% !important;
  height: 44px !important;
  padding: 0.55rem 4px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.ws-workstation-page .ws-task-manual-modal .ws-task-manual-search-clear {
  position: static !important;
  top: auto !important;
  right: auto !important;
  transform: none !important;
}

body.ws-workstation-page .ws-task-manual-options {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  max-height: min(52dvh, 500px);
  overflow: auto;
  padding: 2px 4px 2px 2px;
}

body.ws-workstation-page .ws-task-manual-modal .modal-body {
  overflow: visible;
}

body.ws-workstation-page .ws-task-manual-modal .ws-task-manual-search {
  display: block !important;
  position: relative !important;
  z-index: 20 !important;
  width: 100% !important;
  min-height: 0 !important;
  margin: 0 0 14px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  pointer-events: auto !important;
}

.ws-task-manual-modal .ws-task-manual-search-input,
.ws-task-manual-modal .ws-task-manual-search input[type="text"],
.ws-task-manual-modal .ws-task-manual-search input[type="search"],
body.ws-workstation-page .ws-task-manual-modal .ws-task-manual-search-input,
body.ws-workstation-page .ws-task-manual-modal .ws-task-manual-search input[type="text"],
body.ws-workstation-page .ws-task-manual-modal .ws-task-manual-search input[type="search"] {
  display: block !important;
  position: relative !important;
  z-index: 21 !important;
  width: 100% !important;
  height: 46px !important;
  padding: 0.62rem 1rem !important;
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.98) !important;
  color: var(--app-text) !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05) !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  user-select: text !important;
  -webkit-user-select: text !important;
}

.ws-task-manual-modal .ws-task-manual-search-input:focus,
.ws-task-manual-modal .ws-task-manual-search input[type="text"]:focus,
.ws-task-manual-modal .ws-task-manual-search input[type="search"]:focus,
body.ws-workstation-page .ws-task-manual-modal .ws-task-manual-search-input:focus,
body.ws-workstation-page .ws-task-manual-modal .ws-task-manual-search input[type="text"]:focus,
body.ws-workstation-page .ws-task-manual-modal .ws-task-manual-search input[type="search"]:focus {
  border-color: color-mix(in srgb, var(--app-primary-color, #794bff) 55%, transparent) !important;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--app-primary-color, #794bff) 12%, transparent), 0 10px 24px rgba(15, 23, 42, 0.05) !important;
}

.ws-task-manual-modal .ws-task-manual-search {
  display: grid !important;
  grid-template-columns: 42px minmax(0, 1fr) 38px !important;
  align-items: center !important;
  position: relative !important;
  z-index: 20 !important;
  width: 100% !important;
  min-height: 48px !important;
  margin: 0 0 14px !important;
  padding: 0 !important;
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.98) !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05) !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.ws-task-manual-modal .ws-task-manual-search-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 42px !important;
  height: 46px !important;
  color: rgba(100, 116, 139, 0.76) !important;
  pointer-events: none !important;
}

.ws-task-manual-modal .ws-task-manual-search-input,
.ws-task-manual-modal .ws-task-manual-search input[type="text"],
body.ws-workstation-page .ws-task-manual-modal .ws-task-manual-search-input,
body.ws-workstation-page .ws-task-manual-modal .ws-task-manual-search input[type="text"] {
  display: block !important;
  position: relative !important;
  z-index: 22 !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 46px !important;
  padding: 0 8px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--app-text) !important;
  font-weight: 800 !important;
  pointer-events: auto !important;
  user-select: text !important;
  -webkit-user-select: text !important;
}

.ws-task-manual-modal .ws-task-manual-search-input:focus,
.ws-task-manual-modal .ws-task-manual-search input[type="text"]:focus,
body.ws-workstation-page .ws-task-manual-modal .ws-task-manual-search-input:focus,
body.ws-workstation-page .ws-task-manual-modal .ws-task-manual-search input[type="text"]:focus {
  outline: none !important;
}

.ws-task-manual-modal .ws-task-manual-search:focus-within {
  border-color: color-mix(in srgb, var(--app-primary-color, #794bff) 55%, transparent) !important;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--app-primary-color, #794bff) 12%, transparent), 0 10px 24px rgba(15, 23, 42, 0.05) !important;
}

.ws-task-manual-modal .ws-task-manual-search-clear,
body.ws-workstation-page .ws-task-manual-modal .ws-task-manual-search-clear {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: static !important;
  width: 28px !important;
  height: 28px !important;
  margin: 0 6px 0 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: rgba(226, 232, 240, 0.92) !important;
  color: rgba(71, 85, 105, 0.88) !important;
  opacity: 0 !important;
  transform: scale(0.94) !important;
  pointer-events: none !important;
}

.ws-task-manual-modal .ws-task-manual-search.has-value .ws-task-manual-search-clear,
body.ws-workstation-page .ws-task-manual-modal .ws-task-manual-search.has-value .ws-task-manual-search-clear {
  opacity: 1 !important;
  transform: scale(1) !important;
  pointer-events: auto !important;
}

body.ws-workstation-page .ws-task-manual-option {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--app-text);
  cursor: pointer;
  padding: 12px 14px;
  text-align: left;
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

body.ws-workstation-page .ws-task-manual-option:hover {
  border-color: color-mix(in srgb, var(--app-primary-color, #794bff) 34%, transparent);
  background: rgba(241, 245, 249, 0.92);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

body.ws-workstation-page .ws-task-manual-option.is-selected {
  border-color: color-mix(in srgb, var(--app-primary-color, #794bff) 55%, transparent);
  background: rgba(240, 253, 250, 0.92);
  box-shadow: 0 18px 38px rgba(13, 148, 136, 0.15);
}

body.ws-workstation-page .ws-task-manual-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.06);
  color: #0f766e;
  font-size: 1rem;
}

body.ws-workstation-page .ws-task-manual-option.is-selected .ws-task-manual-icon {
  background: color-mix(in srgb, var(--app-primary-color, #794bff) 16%, transparent);
  color: #0f766e;
}

body.ws-workstation-page .ws-task-manual-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

body.ws-workstation-page .ws-task-manual-copy strong {
  min-width: 0;
  overflow: hidden;
  color: var(--app-text);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.ws-workstation-page .ws-task-manual-copy small {
  min-width: 0;
  overflow: hidden;
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.ws-workstation-page .ws-task-manual-side {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

body.ws-workstation-page .ws-task-manual-side > i {
  color: rgba(100, 116, 139, 0.62);
  font-size: 0.78rem;
  transition: color 0.18s ease, transform 0.18s ease;
}

body.ws-workstation-page .ws-task-manual-option:hover .ws-task-manual-side > i,
body.ws-workstation-page .ws-task-manual-option.is-selected .ws-task-manual-side > i {
  color: #0f766e;
  transform: translateX(2px);
}

@media (max-width: 575.98px) {
  body.ws-workstation-page .ws-task-manual-dialog {
    width: calc(100vw - 18px);
    margin: 9px auto;
  }

  body.ws-workstation-page .ws-task-manual-modal .modal-content {
    border-radius: 22px;
  }

  body.ws-workstation-page .ws-task-manual-options {
    max-height: min(56dvh, 500px);
  }

  body.ws-workstation-page .ws-task-manual-option {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    padding: 11px;
  }

  body.ws-workstation-page .ws-task-manual-icon {
    width: 38px;
    height: 38px;
    border-radius: 13px;
  }

  body.ws-workstation-page .ws-task-manual-side {
    grid-column: 2;
    justify-content: space-between;
    width: 100%;
  }
}

.access-control-page {
  display: grid;
  gap: 18px;
}

.access-control-page .page-title {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 1.45rem + 1.2vw, 2.5rem);
  font-weight: 900;
}

.settings-sidebar-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: start;
}

.settings-sidebar-section {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.82);
  min-width: 0;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.settings-sidebar-section.is-dragging,
.settings-sidebar-item.is-dragging {
  opacity: 0.52;
  transform: scale(0.995);
}

.settings-sidebar-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: grab;
}

.settings-sidebar-drag-handle {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  color: #64748b;
  background: #ffffff;
  cursor: grab;
}

.settings-sidebar-visible {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.settings-sidebar-visible .apple-switch {
  flex: 0 0 auto;
  transform: scale(0.82);
  transform-origin: center;
}

.settings-sidebar-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 68px;
}

.settings-sidebar-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  background: #ffffff;
  color: #111827;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
  cursor: grab;
}

.settings-sidebar-item > span:first-of-type {
  min-width: 0;
  flex: 1 1 auto;
}

.settings-sidebar-item i {
  color: #94a3b8;
}

.shift-calendar-period-label {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: #64748b !important;
  font-weight: 700;
  white-space: nowrap;
}

.access-control-top {
  align-items: stretch;
}

.access-control-list-card {
  display: grid;
  gap: 18px;
}

.access-control-list-card .app-card-header {
  gap: 14px;
}

.access-control-search {
  position: relative;
  width: min(360px, 100%);
}

.access-control-search i {
  position: absolute;
  top: 50%;
  left: 16px;
  color: var(--app-muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.access-control-search .form-control {
  padding-left: 42px;
}

.access-control-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.access-control-columns h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 900;
}

.access-control-rows,
.access-control-memberships {
  display: grid;
  gap: 10px;
}

.access-control-row,
.access-control-membership,
.access-control-assign-form {
  border: 1px solid var(--app-border);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.68);
  padding: 12px;
}

.access-control-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(150px, 1fr) minmax(170px, 1fr) minmax(108px, auto) minmax(116px, auto);
  gap: 10px;
  align-items: center;
  overflow: hidden;
}

.access-control-row-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.access-control-row-title strong,
.access-control-row-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-control-row-title span {
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.access-control-row-actions,
.access-control-membership {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.access-control-membership {
  justify-content: space-between;
}

.access-control-assign-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) minmax(130px, auto);
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

@media (max-width: 1400px) {
  .access-control-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1700px) {
  .access-control-row {
    grid-template-columns: minmax(150px, 0.8fr) minmax(160px, 1fr) minmax(160px, 1fr);
  }

  .access-control-row-actions {
    grid-column: 1 / -1;
  }

  .access-control-row-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 1100px) {
  .access-control-columns,
  .access-control-assign-form {
    grid-template-columns: 1fr;
  }

  .access-control-row {
    grid-template-columns: 1fr;
  }

  .access-control-row-actions {
    justify-content: flex-start;
  }
}

.permission-matrix-page {
  display: grid;
  gap: 18px;
}

.permission-matrix-card {
  min-height: min(720px, calc(100vh - 190px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
}

.permission-matrix-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.permission-matrix-toolbar h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
}

.permission-type-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px;
  border-radius: 18px;
  background: rgba(226, 232, 240, 0.72);
}

.permission-type-tab {
  min-width: 78px;
  border-radius: 14px;
  padding: 10px 15px;
  color: var(--app-text);
  font-family: Quicksand, sans-serif;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  transition: background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.permission-type-tab:hover,
.permission-type-tab.active {
  background: #ffffff !important;
  color: #0f172a !important;
  text-decoration: none;
  box-shadow: var(--app-shadow-soft);
}

.permission-matrix-scroll {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--app-border);
  border-radius: 20px;
}

.permission-matrix-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.permission-matrix-table th,
.permission-matrix-table td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.82);
  vertical-align: middle;
  text-align: center;
  white-space: nowrap;
}

.permission-matrix-table th:first-child,
.permission-matrix-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  text-align: left;
  min-width: 250px;
  background: var(--app-card-bg);
}

.permission-matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f8fafc;
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.permission-matrix-table thead th:first-child {
  z-index: 4;
  background: #f8fafc;
  color: var(--app-muted);
}

.permission-matrix-table th span {
  display: block;
  color: var(--app-text);
}

.permission-matrix-table th small {
  display: block;
  color: var(--app-muted);
  font-size: 0.68rem;
  text-transform: none;
}

.permission-matrix-table td:first-child strong,
.permission-matrix-table td:first-child span {
  display: block;
}

.permission-matrix-table td:first-child span {
  color: var(--app-muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.permission-category-row td {
  background: #f8fafc !important;
  color: var(--app-muted);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.permission-toggle {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #38404a;
  color: #fff;
  box-shadow: none;
}

.permission-toggle.is-on {
  background: #22c55e;
}

.permission-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.88;
}

.permission-not-applicable {
  min-width: 30px;
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  color: #94a3b8;
  font-size: 1.1rem;
  font-weight: 900;
}

.profile-avatar-presence .presence-dot {
  right: 8px;
  bottom: 8px;
  width: 17px;
  height: 17px;
  border-width: 3px;
}

@media (max-width: 991.98px) {
  .profile-notification-panel:first-child,
  .profile-notification-rule {
    grid-template-columns: 1fr;
  }

  .profile-notification-note {
    justify-self: stretch;
    max-width: none;
  }

  .profile-notification-rules-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-notification-card .app-card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-notification-card .app-card-header .btn {
    width: 100%;
  }
}

@media (max-width: 575.98px) {
  .profile-notification-panel {
    padding: 12px;
    border-radius: 16px;
  }

  .profile-notification-form,
  .profile-notification-panel,
  .profile-notification-rules,
  .profile-notification-rule {
    min-width: 0;
    width: 100%;
  }

  .profile-notification-table {
    min-width: 460px;
    font-size: 0.84rem;
  }

  .profile-notification-rule {
    padding: 10px;
  }

  .profile-notification-rule .task-switch {
    justify-content: space-between;
    width: 100%;
    padding: 8px 0;
  }

  .profile-notification-toggles,
  .profile-notification-rules .task-switch {
    gap: 8px;
  }

  .app-notification-delivery-form {
    grid-template-columns: 1fr;
  }

  .profile-avatar-presence .presence-dot {
    right: 6px;
    bottom: 6px;
    width: 15px;
    height: 15px;
    border-width: 3px;
  }
}

.user-presence-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-presence-cell .app-user-avatar {
  width: 38px;
  height: 38px;
  font-size: 0.95rem;
}

.user-presence-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.user-presence-copy strong,
.user-presence-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-presence-copy small {
  color: var(--app-muted);
  font-size: 0.76rem;
  font-weight: 800;
}

body.ws-workstation-page .ws-task-list {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
}

body.ws-workstation-page .ws-task-status-filter {
  min-width: min(280px, 42vw);
}

body.ws-workstation-page .ws-task-status-filter .select2-container {
  width: 100% !important;
}

body.ws-workstation-page #select2-wsTaskStatusFilter-container .select2-search__field,
body.ws-workstation-page #select2-wsTaskClassFilter-container .select2-search__field {
  width: 0.75rem !important;
  min-width: 0.75rem !important;
  caret-color: transparent;
}

body.ws-workstation-page .ws-task-card {
  width: 100%;
  max-width: 860px;
  margin-left: auto;
  padding: 16px;
  border: 1px solid var(--app-border);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

body.ws-workstation-page .ws-task-card.is-focused {
  border-color: rgba(0, 123, 255, 0.42);
  box-shadow: 0 16px 36px rgba(0, 123, 255, 0.16);
  transform: translateY(-1px);
}

body.ws-workstation-page .ws-task-card-header,
body.ws-workstation-page .ws-task-meta,
body.ws-workstation-page .ws-task-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

body.ws-workstation-page .ws-task-card-header h3 {
  margin: 0;
  color: var(--app-text);
  font-size: clamp(1.02rem, 0.96rem + 0.22vw, 1.18rem);
  font-weight: 900;
  line-height: 1.22;
}

body.ws-workstation-page .ws-task-version-badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.07);
  color: var(--app-muted);
  font-size: 0.68rem;
  font-weight: 900;
}

body.ws-workstation-page .ws-task-priority-badge {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

body.ws-workstation-page .ws-task-priority-badge.is-low {
  border-color: rgba(100, 116, 139, 0.18);
  background: rgba(100, 116, 139, 0.1);
  color: #475569;
}

body.ws-workstation-page .ws-task-priority-badge.is-medium {
  border-color: rgba(59, 130, 246, 0.22);
  background: rgba(59, 130, 246, 0.1);
  color: #1d4ed8;
}

body.ws-workstation-page .ws-task-priority-badge.is-high {
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.14);
  color: #92400e;
}

body.ws-workstation-page .ws-task-priority-badge.is-critical {
  border-color: rgba(220, 38, 38, 0.28);
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

body.ws-workstation-page .ws-task-status-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

body.ws-workstation-page .ws-task-share-btn {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.9);
  color: var(--app-muted);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  cursor: pointer;
}

body.ws-workstation-page .ws-task-share-btn:hover,
body.ws-workstation-page .ws-task-share-btn:focus {
  border-color: rgba(0, 123, 255, 0.28);
  background: rgba(0, 123, 255, 0.08);
  color: var(--app-primary);
  outline: none;
}

body.ws-workstation-page .ws-task-status {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

body.ws-workstation-page .ws-task-status.is-active {
  background: rgba(0, 123, 255, 0.1);
  color: var(--app-primary);
}

body.ws-workstation-page .ws-task-status.is-claimed {
  background: rgba(255, 193, 7, 0.18);
  color: #8a5a00;
}

body.ws-workstation-page .ws-task-status.is-inactive {
  background: rgba(148, 163, 184, 0.14);
  color: #64748b;
}

body.ws-workstation-page .ws-task-status.is-passed {
  background: rgba(40, 167, 69, 0.14);
  color: #15803d;
}

body.ws-workstation-page .ws-task-status.is-failed,
body.ws-workstation-page .ws-task-status.is-expired {
  background: rgba(220, 53, 69, 0.12);
  color: #b91c1c;
}

body.ws-workstation-page .ws-task-status.is-skipped {
  background: rgba(100, 116, 139, 0.14);
  color: #475569;
}

body.ws-workstation-page .ws-task-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  justify-content: stretch;
  gap: 6px;
  margin: 10px 0;
}

body.ws-workstation-page .ws-task-meta-chip {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0 7px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.74);
}

body.ws-workstation-page .ws-task-meta-chip i {
  grid-row: span 2;
  color: var(--app-muted);
  font-size: 0.72rem;
}

body.ws-workstation-page .ws-task-meta-chip small,
body.ws-workstation-page .ws-task-meta-chip strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.ws-workstation-page .ws-task-meta-chip small {
  color: var(--app-muted);
  font-size: 0.6rem;
  font-weight: 900;
  text-transform: uppercase;
}

body.ws-workstation-page .ws-task-meta-chip strong {
  color: var(--app-text);
  font-size: 0.72rem;
  font-weight: 900;
}

body.ws-workstation-page .ws-task-owner {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body.ws-workstation-page .ws-task-owner-avatar {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 999px;
  background: var(--secondary-color);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
}

body.ws-workstation-page .ws-task-owner-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.ws-workstation-page .ws-task-meta-chip strong .ws-task-event-link {
  width: 100%;
  justify-content: flex-start;
}

body.ws-workstation-page .ws-task-event-link {
  min-height: 0;
  padding: 1px 7px 2px;
  border: 1px solid rgba(0, 123, 255, 0.2);
  border-radius: 999px;
  background: rgba(0, 123, 255, 0.08);
  color: #0757c8;
  font: inherit;
  font-weight: 900;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.ws-workstation-page .ws-task-event-link:hover,
body.ws-workstation-page .ws-task-event-link:focus {
  border-color: rgba(0, 123, 255, 0.36);
  background: rgba(0, 123, 255, 0.14);
  color: #043f97;
  text-decoration: none;
  outline: none;
}

body.ws-workstation-page .ws-task-items {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 10px 0;
  padding: 12px 0 0;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.task-visual-control {
  width: 100%;
  min-height: 150px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 14px;
  border: 1px dashed rgba(100, 116, 139, 0.28);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.82);
  color: var(--app-text);
  overflow: hidden;
}

.task-visual-control svg {
  width: min(180px, 100%);
  height: auto;
  display: block;
}

.task-visual-control small,
.task-barcode-visual small {
  max-width: 100%;
  color: var(--app-muted);
  font-size: 0.74rem;
  font-weight: 800;
  overflow-wrap: anywhere;
  text-align: center;
}

.task-visual-control.is-html {
  display: block;
  min-height: 220px;
  padding: 0;
  border-style: solid;
  background: #fff;
}

.task-visual-control.is-html iframe {
  width: 100%;
  min-height: 220px;
  display: block;
  border: 0;
  border-radius: inherit;
  background: #fff;
}

.task-visual-fallback {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--app-muted);
  text-align: center;
}

.task-visual-fallback i {
  font-size: 1.7rem;
}

.task-visual-fallback strong {
  max-width: 100%;
  color: var(--app-text);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.task-barcode-visual {
  width: min(420px, 100%);
  display: grid;
  gap: 8px;
  justify-items: center;
}

.task-barcode-visual > div {
  width: 100%;
  height: 78px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 2px;
  padding: 10px;
  border-radius: 14px;
  background: #fff;
}

.task-barcode-visual span {
  width: var(--bar-width, 2px);
  min-width: 1px;
  display: block;
  background: #111827;
  border-radius: 999px;
}

body.ws-workstation-page .ws-task-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  font-weight: 800;
}

body.ws-workstation-page .ws-task-item > span {
  color: var(--app-text);
  font-size: 0.8rem;
}

body.ws-workstation-page .ws-task-item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

body.ws-workstation-page .ws-task-item-title > span {
  min-width: 0;
}

body.ws-workstation-page .ws-task-item-print {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.92);
  color: var(--app-muted);
  font-size: 0.72rem;
  cursor: pointer;
}

body.ws-workstation-page .ws-task-item-print:hover,
body.ws-workstation-page .ws-task-item-print:focus,
body.ws-workstation-page .ws-task-print-btn:hover,
body.ws-workstation-page .ws-task-print-btn:focus {
  border-color: rgba(16, 185, 129, 0.32);
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  outline: none;
}

body.ws-workstation-page .ws-task-item .form-control {
  min-height: 38px;
  padding-top: 0.42rem;
  padding-bottom: 0.42rem;
  font-size: 0.9rem;
}

body.ws-workstation-page .ws-task-item small {
  color: var(--app-muted);
  font-weight: 700;
}

body.ws-workstation-page .ws-task-note {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px dashed rgba(100, 116, 139, 0.32);
  border-radius: var(--app-radius);
  background: rgba(248, 250, 252, 0.74);
  color: var(--app-muted);
}

body.ws-workstation-page .ws-task-actions {
  display: grid !important;
  grid-template-columns: 1fr auto;
  align-items: center;
  justify-content: stretch;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

body.ws-workstation-page .ws-task-actions-left,
body.ws-workstation-page .ws-task-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

body.ws-workstation-page .ws-task-actions-left {
  justify-content: flex-start;
}

body.ws-workstation-page .ws-task-actions-right {
  justify-content: flex-end;
}

body.ws-workstation-page .ws-task-actions .btn {
  min-height: 34px;
  padding: 0.35rem 0.8rem;
  font-size: 0.82rem;
}

body.ws-workstation-page .ws-task-event-modal .modal-content {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
}

body.ws-workstation-page .ws-task-event-modal .modal-header {
  align-items: flex-start;
  border-bottom: 1px solid var(--app-border);
}

body.ws-workstation-page .ws-task-event-modal .modal-title {
  margin: 0;
  font-weight: 900;
}

body.ws-workstation-page .ws-event-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

body.ws-workstation-page .ws-event-detail-row {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: rgba(248, 250, 252, 0.78);
}

body.ws-workstation-page .ws-event-detail-row span,
body.ws-workstation-page .ws-event-detail-payload span {
  display: block;
  margin-bottom: 4px;
  color: var(--app-muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

body.ws-workstation-page .ws-event-detail-row strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--app-text);
  font-weight: 800;
}

body.ws-workstation-page .ws-event-detail-payload {
  margin-top: 14px;
}

body.ws-workstation-page .ws-event-detail-payload pre {
  max-height: min(38vh, 340px);
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: #0f172a;
  color: #e5edf8;
  font-size: 0.78rem;
}

@media (max-width: 767.98px) {
  body.ws-workstation-page .ws-tasks-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  body.ws-workstation-page .ws-task-filter-header {
    align-items: stretch;
    flex-direction: column;
  }

  body.ws-workstation-page .ws-task-filter-panel {
    overflow: visible;
  }

  body.ws-workstation-page .ws-task-list-panel {
    min-height: 55vh;
  }

  body.ws-workstation-page .ws-task-card {
    max-width: none;
    margin-left: 0;
    padding: 14px;
  }

  body.ws-workstation-page .ws-task-items {
    gap: 10px;
  }

  body.ws-workstation-page .ws-task-meta {
    grid-template-columns: 1fr;
  }

  body.ws-workstation-page .ws-task-actions .btn {
    flex: 1 1 110px;
  }

  body.ws-workstation-page .ws-event-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 991.98px) {
  body.ws-workstation-page .ws-tasks-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  body.ws-workstation-page .ws-task-card {
    max-width: none;
    margin-left: 0;
  }

  body.ws-workstation-page .ws-page-shell,
  body.ws-workstation-page .ws-layout-row,
  body.ws-workstation-page .ws-col-left,
  body.ws-workstation-page .ws-col-right,
  body.ws-workstation-page .sticky-desktop,
  body.ws-workstation-page .ws-left-fixed,
  body.ws-workstation-page .ws-right-stack,
  body.ws-workstation-page .tab-shell,
  body.ws-workstation-page .tab-panel-card,
  body.ws-workstation-page .tab-panel-card .tab-content {
    display: block !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  body.ws-workstation-page .tab-shell {
    flex: 0 0 auto !important;
    margin-bottom: 18px !important;
  }

  body.ws-workstation-page .tab-panel-card {
    min-height: 220px !important;
  }

  body.ws-workstation-page .tab-panel-card .tab-pane {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  body.ws-workstation-page .tab-panel-card .tab-pane.active,
  body.ws-workstation-page .tab-panel-card .tab-pane.show.active {
    display: block !important;
  }

  body.ws-workstation-page .tab-scroll-area,
  body.ws-workstation-page #ordersTab .tab-scroll-area,
  body.ws-workstation-page #downtimeTab .tab-scroll-area,
  body.ws-workstation-page #kpiTab .tab-scroll-area {
    display: block !important;
    height: auto !important;
    min-height: 220px !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 12px !important;
  }

  body.ws-workstation-page #ordersTab .app-table-wrap,
  body.ws-workstation-page #ordersTab .table-responsive,
  body.ws-workstation-page #dtTableView,
  body.ws-workstation-page #dtTableView.app-table-wrap {
    max-height: 60dvh !important;
    overflow: auto !important;
  }
}

/* Workstation PO metric order: Good / Target, Reject, Speed */
body.ws-workstation-page .order-card .order-metrics-compact {
  grid-template-columns: 1fr !important;
}

body.ws-workstation-page .order-card .order-metrics-compact .metric-box-wide {
  grid-column: 1 / -1 !important;
}

body.ws-workstation-page .order-card .order-metrics-compact .metric-box {
  min-width: 0 !important;
}

body.ws-workstation-page .order-card .order-metrics-compact .metric-value {
  font-size: clamp(0.78rem, 0.78vw, 0.98rem) !important;
}

/* Workstation compact PO metrics and rounded surface cleanup */
body.ws-workstation-page .ws-page-shell,
body.ws-workstation-page .ws-layout-row,
body.ws-workstation-page .ws-col-left,
body.ws-workstation-page .ws-col-right,
body.ws-workstation-page .sticky-desktop,
body.ws-workstation-page .ws-left-fixed,
body.ws-workstation-page .ws-right-stack,
body.ws-workstation-page .tab-shell {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
}

body.ws-workstation-page .order-card,
body.ws-workstation-page .po-actions-card,
body.ws-workstation-page .global-filters-card,
body.ws-workstation-page .segment-tabs-wrap,
body.ws-workstation-page .tab-panel-card {
  border-radius: 22px !important;
  background: var(--app-surface-solid) !important;
  border: 0 !important;
  overflow: hidden !important;
}

body.ws-workstation-page .filters-shell,
body.ws-workstation-page .segment-tabs-wrap {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}

body.ws-workstation-page .segment-tabs {
  border-radius: 22px !important;
  overflow: hidden !important;
}

@media (min-width: 992px) {
  body.ws-workstation-page .order-card .asset-header {
    min-height: 52px !important;
    padding: 10px 14px !important;
  }

  body.ws-workstation-page .order-card .card-body {
    padding: 10px 12px !important;
    gap: 7px !important;
    overflow: hidden !important;
  }

  body.ws-workstation-page .order-card #statusBadge,
  body.ws-workstation-page .order-card .badge-order#statusBadge {
    padding: 6px 10px !important;
    font-size: 0.72rem !important;
  }

  body.ws-workstation-page .order-card .order-meta-row {
    gap: 4px !important;
    font-size: clamp(0.78rem, 0.74vw, 0.88rem) !important;
    line-height: 1.18 !important;
  }

  body.ws-workstation-page .order-card .order-metrics-compact {
    gap: 6px !important;
  }

  body.ws-workstation-page .order-card .order-metrics-compact .metric-box {
    min-height: clamp(44px, 5dvh, 54px) !important;
    padding: 6px 8px !important;
    border-radius: 12px !important;
  }

  body.ws-workstation-page .order-card .order-metrics-compact .metric-label {
    font-size: clamp(0.56rem, 0.52vw, 0.64rem) !important;
    margin-bottom: 1px !important;
  }

  body.ws-workstation-page .order-card .order-metrics-compact .metric-value {
    font-size: clamp(0.78rem, 0.72vw, 0.92rem) !important;
    line-height: 1.08 !important;
  }

  body.ws-workstation-page .order-card .progress {
    height: 18px !important;
    min-height: 18px !important;
    margin: 5px 0 !important;
  }

  body.ws-workstation-page .order-card .progress-bar {
    line-height: 18px !important;
    font-size: 0.68rem !important;
  }

  body.ws-workstation-page .order-card .order-dates-compact {
    gap: 6px !important;
  }

  body.ws-workstation-page .order-card .order-dates-compact .date-box {
    min-height: clamp(44px, 5.2dvh, 54px) !important;
    padding: 6px 8px !important;
    font-size: clamp(0.68rem, 0.66vw, 0.78rem) !important;
    border-radius: 12px !important;
  }

  body.ws-workstation-page .order-card .order-dates-compact .date-box b {
    font-size: 0.62rem !important;
  }

  body.ws-workstation-page .order-card .order-dates-detailed .date-box {
    min-height: clamp(62px, 7.2dvh, 76px) !important;
  }

  body.ws-workstation-page .order-card .order-dates-detailed .date-secondary {
    font-size: 0.66rem !important;
  }

  body.ws-workstation-page .order-card .order-dates-detailed .date-primary {
    font-size: 0.72rem !important;
  }

  body.ws-workstation-page .po-actions-card .card-body {
    padding: 10px 12px !important;
  }

  body.ws-workstation-page .po-actions-grid .btn {
    min-height: clamp(38px, 5.4dvh, 48px) !important;
    border-radius: 16px !important;
  }
}

/* Workstation responsive polish after embedded PO actions */
body.ws-workstation-page .order-card .order-dates-detailed .date-box b {
  text-transform: uppercase !important;
}

body.ws-workstation-page .order-related-divider {
  width: 100%;
  height: 1px;
  margin: 2px 0 0;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.34), transparent);
  flex: 0 0 auto;
}

body.ws-workstation-page .order-related-instances {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.74);
  overflow: hidden;
}

body.ws-workstation-page .order-related-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--app-muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

body.ws-workstation-page .order-related-title strong {
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(13, 110, 253, 0.12);
  color: var(--app-primary);
  font-size: 0.7rem;
}

body.ws-workstation-page .order-related-list {
  min-height: 0;
  display: grid;
  gap: 6px;
  overflow: auto;
  padding-right: 2px;
}

body.ws-workstation-page .order-related-chip {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 13px;
  color: var(--app-text);
  background: #fff;
  text-decoration: none !important;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

body.ws-workstation-page .order-related-chip:hover,
body.ws-workstation-page .order-related-chip:focus {
  transform: translateY(-1px);
  border-color: rgba(13, 110, 253, 0.28);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

body.ws-workstation-page .order-related-chip span {
  min-width: 0;
  display: grid;
  gap: 5px;
}

body.ws-workstation-page .order-related-chip strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.ws-workstation-page .order-related-chip strong {
  font-size: clamp(0.74rem, 0.72vw, 0.84rem);
}

body.ws-workstation-page .order-related-chip .badge-order {
  margin: 0 !important;
  padding: 4px 7px !important;
  font-size: 0.62rem !important;
  white-space: nowrap;
}

body.ws-workstation-page .order-related-progress {
  display: block;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
}

body.ws-workstation-page .order-related-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--app-success, #22c55e);
}

@media (min-width: 768px) {
  body.ws-workstation-page .order-card .card-body {
    justify-content: space-between !important;
  }

  body.ws-workstation-page .order-card .order-meta-row,
  body.ws-workstation-page .order-card .order-metrics-compact,
  body.ws-workstation-page .order-card .progress,
  body.ws-workstation-page .order-card .order-dates-compact,
  body.ws-workstation-page .order-card .order-actions-section {
    flex: 0 0 auto !important;
  }

  body.ws-workstation-page .order-card .order-related-instances {
    min-height: 88px;
  }
}

@media (max-width: 767.98px) {
  body.ws-workstation-page .ws-page,
  body.ws-workstation-page main {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  body.ws-workstation-page .ws-page-shell {
    gap: 14px !important;
    padding-bottom: 16px !important;
  }

  body.ws-workstation-page .ws-layout-row {
    gap: 12px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body.ws-workstation-page .ws-col-left,
  body.ws-workstation-page .ws-col-right {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-bottom: 12px !important;
  }

  body.ws-workstation-page .ws-left-fixed,
  body.ws-workstation-page .ws-right-stack {
    gap: 14px !important;
  }

  body.ws-workstation-page .order-card {
    height: auto !important;
    min-height: 0 !important;
    border-radius: 18px !important;
  }

  body.ws-workstation-page .order-card .card-body {
    height: auto !important;
    min-height: 0 !important;
    justify-content: flex-start !important;
    gap: 11px !important;
    overflow: visible !important;
  }

  body.ws-workstation-page .order-actions-section {
    margin-top: 4px !important;
    padding-top: 11px !important;
  }

  body.ws-workstation-page .order-card .order-metrics-compact {
    gap: 8px !important;
  }

  body.ws-workstation-page .order-card .order-dates-compact {
    gap: 10px !important;
  }

  body.ws-workstation-page .order-card .order-related-instances {
    flex: 0 0 auto !important;
    max-height: 180px;
  }

  body.ws-workstation-page .order-card .order-metrics-compact .metric-box {
    min-height: 50px !important;
  }

  body.ws-workstation-page .global-filters-card,
  body.ws-workstation-page .segment-tabs-wrap,
  body.ws-workstation-page .segment-tabs,
  body.ws-workstation-page .tab-panel-card {
    border-radius: 18px !important;
  }

  body.ws-workstation-page .filters-shell,
  body.ws-workstation-page .segment-tabs-wrap,
  body.ws-workstation-page .tab-panel-card {
    margin-bottom: 14px !important;
  }

  body.ws-workstation-page .global-filters-card,
  body.ws-workstation-page .segment-tabs-wrap,
  body.ws-workstation-page .tab-panel-card,
  body.ws-workstation-page .order-card {
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07) !important;
  }

  body.ws-workstation-page .tab-scroll-area {
    padding: 12px !important;
  }

  body.ws-workstation-page .ws-feed-toolbar {
    align-items: stretch;
    gap: 12px;
  }

  body.ws-workstation-page .ws-feed-search-wrap {
    width: 100%;
    justify-content: stretch;
    margin-left: 0;
  }

  body.ws-workstation-page .ws-feed-search-wrap .form-control {
    flex: 1 1 auto;
  }
}

/* Workstation tabs final responsive pass */
body.ws-workstation-page .segment-tabs {
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)) !important;
  align-items: stretch;
}

body.ws-workstation-page .segment-tabs .nav-item,
body.ws-workstation-page .segment-tabs .nav-link {
  min-width: 0;
  width: 100%;
}

body.ws-workstation-page .segment-tabs .nav-link {
  min-height: 44px;
  padding: 0.5rem 0.55rem;
  overflow: visible;
}

body.ws-workstation-page .segment-tabs .nav-link > i {
  flex: 0 0 auto;
}

body.ws-workstation-page .segment-tabs .segment-badge {
  z-index: 2;
}

@media (max-width: 575.98px) {
  body.ws-workstation-page .segment-tabs {
    grid-template-columns: repeat(auto-fit, minmax(42px, 1fr)) !important;
    gap: 4px !important;
    padding: 5px !important;
  }

  body.ws-workstation-page .segment-tabs .nav-link {
    min-height: 40px !important;
    padding: 0.35rem 0.2rem !important;
    border-radius: 13px !important;
  }

  body.ws-workstation-page .segment-tabs .nav-link i {
    font-size: 1rem;
  }

  body.ws-workstation-page .segment-tabs .segment-badge {
    top: -3px !important;
    right: -2px !important;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 0.6rem;
    line-height: 16px;
    transform: none;
  }
}

/* Shared segmented controls and period navigation */
.shift-calendar-view,
.scheduler-view-toggle,
.ws-filter-segments,
.segment-tabs,
.traceability-tabs {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 5px !important;
  border-radius: 16px !important;
  background: #eef2f6 !important;
  box-shadow: inset 0 0 0 1px rgba(226, 232, 240, .8) !important;
  overflow: hidden !important;
}

.ws-filter-segments,
.segment-tabs {
  display: grid !important;
}

.ws-filter-segments {
  grid-auto-flow: column !important;
  grid-auto-columns: minmax(0, 1fr) !important;
  width: 100% !important;
}

.segment-tabs {
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)) !important;
  width: 100% !important;
}

.scheduler-view-toggle label,
.scheduler-view-toggle .btn,
.shift-calendar-view button,
.traceability-tabs .btn,
.ws-filter-segment,
.segment-tabs .nav-link {
  position: relative !important;
  z-index: 1 !important;
  min-height: 38px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: transparent !important;
  color: #334155 !important;
  box-shadow: none !important;
  font-weight: 900 !important;
}

.scheduler-view-toggle label.active,
.scheduler-view-toggle .btn.active,
.shift-calendar-view button.active,
.traceability-tabs .btn.active,
.ws-filter-segment.active,
.segment-tabs .nav-link.active {
  color: #111827 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.shift-calendar-nav .btn,
.scheduler-nav .btn,
.raw-events-shift-nav .btn,
.ws-period-btn,
.ws-period-current {
  height: 40px !important;
  min-height: 40px !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  font-weight: 900 !important;
}

.shift-calendar-nav .btn-light,
.scheduler-nav .btn-light,
.raw-events-shift-nav .btn-light,
.ws-period-btn {
  min-width: 44px !important;
  width: 44px !important;
  padding: 0 !important;
  background: #fff !important;
  color: #334155 !important;
  border: 1px solid rgba(226, 232, 240, .95) !important;
}

.shift-calendar-nav .btn-primary,
.scheduler-nav .btn-primary,
.raw-events-shift-nav .btn-primary,
.shift-calendar-nav #todayBtn,
.scheduler-nav #navTodayBtn,
.raw-events-shift-nav #shiftCurrentBtn,
.ws-period-current {
  min-width: 96px !important;
  padding: 0 16px !important;
  background: var(--app-primary-color, #111827) !important;
  border: 1px solid var(--app-primary-color, #111827) !important;
  color: #fff !important;
}

.shift-calendar-nav .btn-primary:hover,
.scheduler-nav .btn-primary:hover,
.raw-events-shift-nav .btn-primary:hover,
.raw-events-shift-nav #shiftCurrentBtn:hover,
.ws-period-current:hover {
  background: var(--app-primary-color, #111827) !important;
  border-color: var(--app-primary-color, #111827) !important;
  color: #fff !important;
  box-shadow: none !important;
}

body.ws-workstation-page .tab-panel-card {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.ws-workstation-page .tab-scroll-area {
  padding: 0 !important;
  background: transparent !important;
}

/* Workstation refinements */
body.ws-workstation-page #kpiTab .kpi-gauge-grid {
  margin: 0 0 10px !important;
}

body.ws-workstation-page .ws-tasks-layout {
  grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
}

body.ws-workstation-page .ws-task-list {
  min-height: 0;
  height: 100%;
  padding: 2px 4px 2px 0;
}

body.ws-workstation-page .ws-task-card {
  --task-priority-color: rgba(100, 116, 139, 0.46);
  border-left: 7px solid var(--task-priority-color) !important;
}

body.ws-workstation-page .ws-task-card.is-low {
  --task-priority-color: rgba(100, 116, 139, 0.48);
}

body.ws-workstation-page .ws-task-card.is-medium {
  --task-priority-color: rgba(59, 130, 246, 0.58);
}

body.ws-workstation-page .ws-task-card.is-high {
  --task-priority-color: rgba(245, 158, 11, 0.72);
}

body.ws-workstation-page .ws-task-card.is-critical {
  --task-priority-color: rgba(220, 38, 38, 0.72);
}

body.ws-workstation-page .ws-task-card:not(.is-claimed) .ws-task-meta {
  margin-bottom: 8px;
}

body.ws-workstation-page .ws-task-priority-badge {
  display: none !important;
}

body.ws-workstation-page .ws-feed-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden !important;
}

body.ws-workstation-page .ws-feed-stream-card {
  display: contents !important;
}

body.ws-workstation-page .ws-feed-toolbar {
  position: sticky;
  top: 0;
  z-index: 12;
  margin: 0;
  padding: 6px 0 12px;
  background: linear-gradient(
    180deg,
    rgba(245, 246, 248, 0.68) 0%,
    rgba(245, 246, 248, 0.36) 72%,
    rgba(245, 246, 248, 0) 100%
  );
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

body.ws-workstation-page .ws-feed-search-wrap {
  width: 100%;
}

body.ws-workstation-page .ws-feed-list {
  flex: 1 1 auto;
  padding: 10px 4px 0 0;
}

@media (max-width: 991.98px) {
  body.ws-workstation-page .ws-tasks-layout {
    grid-template-columns: 1fr;
  }

  body.ws-workstation-page .ws-task-list {
    height: auto;
    min-height: 42vh;
    overflow: visible;
  }
}

@media (max-width: 575.98px) {
  body.ws-workstation-page .ws-feed-toolbar {
    padding: 4px 0 10px;
  }

  body.ws-workstation-page .ws-feed-search-wrap {
    align-items: stretch;
    flex-direction: column;
  }

  body.ws-workstation-page .ws-feed-search-wrap .btn,
  body.ws-workstation-page .ws-feed-search-wrap .form-control {
    width: 100%;
  }
}

/* Workstation visual fixes */
body.ws-workstation-page #kpiTab .kpi-gauge-item {
  background: #fff !important;
}

body.ws-workstation-page #kpiTab .kpi-card,
body.ws-workstation-page #kpiTab .kpi-gauge-item,
body.ws-workstation-page #kpiTab .kpi-chart-card,
body.ws-workstation-page #kpiTab .kpi-summary-card {
  box-shadow: none !important;
  transition: none !important;
}

body.ws-workstation-page #kpiTab .kpi-card:hover,
body.ws-workstation-page #kpiTab .kpi-gauge-item:hover,
body.ws-workstation-page #kpiTab .kpi-chart-card:hover,
body.ws-workstation-page #kpiTab .kpi-summary-card:hover {
  border-color: var(--app-border) !important;
  box-shadow: none !important;
  transform: none !important;
}

.shift-calendar-view button.active,
.scheduler-view-toggle label.active,
.scheduler-view-toggle .btn.active,
.ws-filter-segment.active,
.segment-tabs .nav-link.active {
  background: #fff !important;
  color: #111827 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08) !important;
}

.shift-calendar-nav #todayBtn,
.scheduler-nav #navTodayBtn,
.raw-events-shift-nav #shiftCurrentBtn,
body.ws-workstation-page .ws-period-current {
  background: var(--app-primary-color, #111827) !important;
  border-color: var(--app-primary-color, #111827) !important;
  color: #fff !important;
}

.shift-calendar-nav #todayBtn:hover,
.scheduler-nav #navTodayBtn:hover,
.raw-events-shift-nav #shiftCurrentBtn:hover,
body.ws-workstation-page .ws-period-current:hover {
  background: var(--app-primary-color, #111827) !important;
  border-color: var(--app-primary-color, #111827) !important;
  color: #fff !important;
}

body.ws-workstation-page .ws-task-title-wrap {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

body.ws-workstation-page .ws-task-collapse-toggle {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.9);
  color: var(--app-muted);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  cursor: pointer;
}

body.ws-workstation-page .ws-task-collapse-toggle:hover,
body.ws-workstation-page .ws-task-collapse-toggle:focus {
  border-color: color-mix(in srgb, var(--app-primary-color, #111827) 28%, transparent);
  background: color-mix(in srgb, var(--app-primary-color, #111827) 8%, white);
  color: var(--app-primary-color, #111827);
  outline: none;
}

body.ws-workstation-page .ws-task-collapse-toggle i {
  transition: transform 0.18s ease;
}

body.ws-workstation-page .ws-task-items,
body.ws-workstation-page .ws-task-comment {
  overflow: hidden;
  transition: max-height 0.24s ease, opacity 0.18s ease, transform 0.2s ease, margin 0.2s ease;
}

body.ws-workstation-page .ws-task-card.is-claimed .ws-task-collapse-toggle i,
body.ws-workstation-page .ws-task-card.is-expanded .ws-task-collapse-toggle i {
  transform: rotate(180deg);
}

body.ws-workstation-page .ws-task-card:not(.is-claimed):not(.is-expanded) .ws-task-items,
body.ws-workstation-page .ws-task-card:not(.is-claimed):not(.is-expanded) .ws-task-comment {
  max-height: 0 !important;
  opacity: 0;
  transform: translateY(-6px);
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  pointer-events: none;
}

body.ws-workstation-page .ws-task-card.is-expanded .ws-task-items,
body.ws-workstation-page .ws-task-card.is-claimed .ws-task-items {
  display: flex !important;
  max-height: 1400px;
  opacity: 1;
  transform: translateY(0);
}

body.ws-workstation-page .ws-task-card.is-expanded .ws-task-comment,
body.ws-workstation-page .ws-task-card.is-claimed .ws-task-comment {
  display: grid !important;
  max-height: 260px;
  opacity: 1;
  transform: translateY(0);
}

body.ws-workstation-page .order-related-stack {
  flex: 0 0 auto;
  gap: 8px;
  overflow: visible;
}

body.ws-workstation-page .order-related-stack .order-related-list {
  position: relative;
  min-height: 68px;
  overflow: visible;
  padding: 4px 2px 16px;
}

body.ws-workstation-page .order-related-stack .order-related-chip {
  position: absolute;
  left: 0;
  right: 0;
  min-height: 56px;
  transform: translateY(calc(var(--stack-index) * 8px)) scale(calc(1 - var(--stack-index) * 0.035));
  transform-origin: top center;
  transition: transform 0.28s cubic-bezier(.2, .8, .2, 1), border-color 0.18s ease, box-shadow 0.18s ease;
}

body.ws-workstation-page .order-related-stack .order-related-chip:nth-child(1) { z-index: 5; }
body.ws-workstation-page .order-related-stack .order-related-chip:nth-child(2) { z-index: 4; }
body.ws-workstation-page .order-related-stack .order-related-chip:nth-child(3) { z-index: 3; }
body.ws-workstation-page .order-related-stack .order-related-chip:nth-child(4) { z-index: 2; }
body.ws-workstation-page .order-related-stack .order-related-chip:nth-child(n+5) { z-index: 1; }

@media (hover: hover) {
  body.ws-workstation-page .order-related-stack:hover .order-related-list,
  body.ws-workstation-page .order-related-stack:focus-within .order-related-list {
    min-height: calc(64px * var(--related-count, 3));
  }

  body.ws-workstation-page .order-related-stack:hover .order-related-chip,
  body.ws-workstation-page .order-related-stack:focus-within .order-related-chip {
    position: relative;
    transform: translateY(0) scale(1);
    margin-bottom: 7px;
  }
}

body.ws-workstation-page .order-related-stack.is-expanded .order-related-list {
  min-height: auto;
}

body.ws-workstation-page .order-related-stack.is-expanded .order-related-chip {
  position: relative;
  transform: translateY(0) scale(1);
  margin-bottom: 7px;
}

body.ws-workstation-page .order-related-toggle {
  align-self: stretch;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  background: var(--app-primary-color, #111827);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}

body.ws-workstation-page .order-related-toggle i {
  transition: transform 0.18s ease;
}

body.ws-workstation-page .order-related-stack.is-expanded .order-related-toggle i {
  transform: rotate(180deg);
}

@media (max-width: 767.98px) {
  body.ws-workstation-page .order-related-stack .order-related-list,
  body.ws-workstation-page .order-related-stack.is-expanded .order-related-list {
    min-height: auto;
  }

  body.ws-workstation-page .order-related-stack .order-related-chip {
    position: relative;
    transform: none;
    margin-bottom: 7px;
  }
}

/* Same-order stack: click-to-reveal upward cards */
body.ws-workstation-page .ws-left-fixed,
body.ws-workstation-page .order-card,
body.ws-workstation-page .order-card .card-body {
  overflow: visible !important;
}

body.ws-workstation-page .order-related-stack {
  position: relative;
  z-index: 25;
  flex: 0 0 auto;
  isolation: isolate;
}

body.ws-workstation-page .order-related-stack .order-related-list {
  position: relative !important;
  height: 66px;
  min-height: 66px !important;
  overflow: visible !important;
  padding: 0 2px;
}

body.ws-workstation-page .order-related-stack .order-related-chip {
  position: absolute !important;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 56px;
  margin: 0 !important;
  border-radius: 14px;
  transform:
    translateY(calc(var(--stack-index) * 8px))
    scale(calc(1 - var(--stack-index) * 0.035)) !important;
  transform-origin: bottom center;
  transition:
    transform 0.42s cubic-bezier(.3, .9, .3, 1),
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease !important;
}

body.ws-workstation-page .order-related-stack .order-related-chip:nth-child(1) { z-index: 10; }
body.ws-workstation-page .order-related-stack .order-related-chip:nth-child(2) { z-index: 9; }
body.ws-workstation-page .order-related-stack .order-related-chip:nth-child(3) { z-index: 8; }
body.ws-workstation-page .order-related-stack .order-related-chip:nth-child(4) { z-index: 7; }
body.ws-workstation-page .order-related-stack .order-related-chip:nth-child(5) { z-index: 6; }
body.ws-workstation-page .order-related-stack .order-related-chip:nth-child(n+6) { z-index: 5; }

body.ws-workstation-page .order-related-stack.is-expanded {
  z-index: 90;
}

body.ws-workstation-page .order-related-stack.is-expanded .order-related-list {
  height: 66px;
  min-height: 66px !important;
}

body.ws-workstation-page .order-related-stack.is-expanded .order-related-chip {
  position: absolute !important;
  transform:
    translateY(calc(var(--stack-index) * -64px))
    scale(1) !important;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.16);
}

@media (hover: hover) {
  body.ws-workstation-page .order-related-stack:hover .order-related-list,
  body.ws-workstation-page .order-related-stack:focus-within .order-related-list {
    height: 66px;
    min-height: 66px !important;
  }

  body.ws-workstation-page .order-related-stack:hover .order-related-chip,
  body.ws-workstation-page .order-related-stack:focus-within .order-related-chip {
    position: absolute !important;
    margin: 0 !important;
    transform:
      translateY(calc(var(--stack-index) * 8px))
      scale(calc(1 - var(--stack-index) * 0.035)) !important;
  }

  body.ws-workstation-page .order-related-stack.is-expanded:hover .order-related-chip,
  body.ws-workstation-page .order-related-stack.is-expanded:focus-within .order-related-chip {
    transform:
      translateY(calc(var(--stack-index) * -64px))
      scale(1) !important;
  }
}

body.ws-workstation-page .order-related-toggle {
  position: relative;
  z-index: 95;
}

body.ws-workstation-page #kpiTab,
body.ws-workstation-page #kpiTab .tab-scroll-area {
  overflow-x: hidden !important;
}

body.ws-workstation-page #kpiTab .row {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

body.ws-workstation-page #kpiTab .row > [class*="col-"] {
  min-width: 0;
  padding-left: 5px !important;
  padding-right: 5px !important;
}

body.ws-workstation-page #kpiTab .kpi-gauge-grid {
  width: 100%;
}

@media (max-width: 767.98px) {
  body.ws-workstation-page .order-related-stack .order-related-list,
  body.ws-workstation-page .order-related-stack.is-expanded .order-related-list {
    height: auto;
    min-height: auto !important;
  }

  body.ws-workstation-page .order-related-stack .order-related-chip,
  body.ws-workstation-page .order-related-stack.is-expanded .order-related-chip {
    position: relative !important;
    transform: none !important;
    margin-bottom: 7px !important;
  }
}

/* Same-order stack spacing fix */
body.ws-workstation-page .order-related-stack {
  gap: 10px !important;
  padding-bottom: 10px !important;
}

body.ws-workstation-page .order-related-stack .order-related-list {
  height: 88px !important;
  min-height: 88px !important;
  padding-bottom: 12px !important;
}

body.ws-workstation-page .order-related-stack.is-expanded .order-related-list {
  height: 76px !important;
  min-height: 76px !important;
}

body.ws-workstation-page .order-related-toggle {
  flex: 0 0 auto;
  margin-top: 2px;
}

@media (max-width: 767.98px) {
  body.ws-workstation-page .order-related-stack {
    padding-bottom: 0 !important;
  }

  body.ws-workstation-page .order-related-stack .order-related-list,
  body.ws-workstation-page .order-related-stack.is-expanded .order-related-list {
    height: auto !important;
    min-height: auto !important;
    padding-bottom: 0 !important;
  }
}

/* Same-order stack overlap and mobile compact order card */
body.ws-workstation-page .order-related-stack {
  overflow: visible !important;
}

body.ws-workstation-page .order-related-stack .order-related-list {
  height: 96px !important;
  min-height: 96px !important;
  padding: 0 2px 22px !important;
}

body.ws-workstation-page .order-related-stack .order-related-chip {
  bottom: 22px !important;
  transform:
    translateY(calc(var(--stack-index) * 7px))
    scale(calc(1 - var(--stack-index) * 0.032)) !important;
}

body.ws-workstation-page .order-related-stack.is-expanded .order-related-chip {
  bottom: 22px !important;
  transform:
    translateY(calc(var(--stack-index) * -64px))
    scale(1) !important;
}

@media (hover: hover) {
  body.ws-workstation-page .order-related-stack:hover .order-related-chip,
  body.ws-workstation-page .order-related-stack:focus-within .order-related-chip {
    transform:
      translateY(calc(var(--stack-index) * 7px))
      scale(calc(1 - var(--stack-index) * 0.032)) !important;
  }

  body.ws-workstation-page .order-related-stack.is-expanded:hover .order-related-chip,
  body.ws-workstation-page .order-related-stack.is-expanded:focus-within .order-related-chip {
    transform:
      translateY(calc(var(--stack-index) * -64px))
      scale(1) !important;
  }
}

body.ws-workstation-page .order-related-toggle {
  margin-top: 0 !important;
}

@media (max-width: 767.98px) {
  body.ws-workstation-page .order-card .asset-header {
    min-height: 48px !important;
    padding: 10px 12px !important;
  }

  body.ws-workstation-page .order-card .asset-header .order-title strong {
    font-size: 0.95rem !important;
  }

  body.ws-workstation-page .order-card .asset-status-chip,
  body.ws-workstation-page .order-card .order-meta-row .text-muted,
  body.ws-workstation-page .order-card .order-metrics-compact .metric-box:not(:first-child),
  body.ws-workstation-page .order-card .order-dates-compact,
  body.ws-workstation-page .order-related-divider,
  body.ws-workstation-page .order-related-instances {
    display: none !important;
  }

  body.ws-workstation-page .order-card .card-body {
    gap: 9px !important;
    padding: 11px 12px !important;
  }

  body.ws-workstation-page .order-card #statusBadge,
  body.ws-workstation-page .order-card .badge-order#statusBadge {
    align-self: flex-start !important;
    margin-bottom: 0 !important;
    padding: 5px 10px !important;
    font-size: 0.72rem !important;
  }

  body.ws-workstation-page .order-card .order-meta-row {
    display: block !important;
    margin: 0 !important;
    font-size: 0.82rem !important;
  }

  body.ws-workstation-page .order-card .order-metrics-compact {
    display: block !important;
  }

  body.ws-workstation-page .order-card .order-metrics-compact .metric-box:first-child {
    min-height: 48px !important;
    padding: 8px 10px !important;
  }

  body.ws-workstation-page .order-card .progress {
    height: 16px !important;
    margin-bottom: 0 !important;
  }

  body.ws-workstation-page .order-actions-section {
    margin-top: 2px !important;
    padding-top: 10px !important;
  }

  body.ws-workstation-page .order-actions-section .po-actions-grid {
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)) !important;
    gap: 10px !important;
  }

  body.ws-workstation-page .po-actions-grid .btn {
    min-height: 46px !important;
    border-radius: 15px !important;
  }
}

/* Compact downtime table */
body.ws-workstation-page #dtTableView .app-data-table {
  border-collapse: separate !important;
  border-spacing: 0 8px !important;
}

.raw-events-table .app-data-table {
  border-collapse: separate !important;
  border-spacing: 0 8px !important;
}

body.ws-workstation-page #dtTableView .app-data-table thead th,
.raw-events-table .app-data-table thead th {
  padding: 10px 14px !important;
  border: 0 !important;
  background: rgba(248, 250, 252, 0.92) !important;
  color: #475569 !important;
  font-size: 0.72rem !important;
  letter-spacing: 0 !important;
}

body.ws-workstation-page #dtTableView .app-data-table tbody tr.dtRow,
.raw-events-table .app-data-table tbody tr.rawEventRow {
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

body.ws-workstation-page #dtTableView .app-data-table tbody tr.dtRow td,
.raw-events-table .app-data-table tbody tr.rawEventRow td {
  padding: 8px 12px !important;
  border: 0 !important;
  background: rgba(255, 255, 255, 0.94) !important;
  vertical-align: middle !important;
}

body.ws-workstation-page #dtTableView .app-data-table tbody tr.dtRow td:first-child,
.raw-events-table .app-data-table tbody tr.rawEventRow td:first-child {
  border-top-left-radius: 16px;
  border-bottom-left-radius: 16px;
}

body.ws-workstation-page #dtTableView .app-data-table tbody tr.dtRow td:last-child,
.raw-events-table .app-data-table tbody tr.rawEventRow td:last-child {
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;
}

body.ws-workstation-page #dtTableView .app-data-table tbody tr.dtRow:hover td,
.raw-events-table .app-data-table tbody tr.rawEventRow:hover td {
  background: #f8fbff !important;
}

body.ws-workstation-page #dtTableView .app-data-table tbody tr.dtRow.table-primary-custom td,
.raw-events-table .app-data-table tbody tr.rawEventRow.table-primary-custom td {
  background: color-mix(in srgb, var(--app-primary-color, #111827) 8%, white) !important;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--app-primary-color, #111827) 24%, transparent),
    inset 0 -1px 0 color-mix(in srgb, var(--app-primary-color, #111827) 24%, transparent) !important;
}

body.ws-workstation-page #dtTableView .app-data-table tbody tr.dtRow.table-primary-custom td:first-child,
.raw-events-table .app-data-table tbody tr.rawEventRow.table-primary-custom td:first-child {
  box-shadow:
    inset 3px 0 0 var(--app-primary-color, #111827),
    inset 0 1px 0 color-mix(in srgb, var(--app-primary-color, #111827) 24%, transparent),
    inset 0 -1px 0 color-mix(in srgb, var(--app-primary-color, #111827) 24%, transparent) !important;
}

body.ws-workstation-page #dtTableView .app-data-table tbody tr.dtRow.table-primary-custom td:last-child,
.raw-events-table .app-data-table tbody tr.rawEventRow.table-primary-custom td:last-child {
  box-shadow:
    inset -1px 0 0 color-mix(in srgb, var(--app-primary-color, #111827) 24%, transparent),
    inset 0 1px 0 color-mix(in srgb, var(--app-primary-color, #111827) 24%, transparent),
    inset 0 -1px 0 color-mix(in srgb, var(--app-primary-color, #111827) 24%, transparent) !important;
}

.dt-timestamp-stack {
  display: grid;
  gap: 3px;
  min-width: 154px;
}

.dt-timestamp-stack span {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.dt-timestamp-stack small,
.dt-reason-comment,
.dt-assignee-copy small {
  color: #64748b;
  font-size: 0.72rem;
  line-height: 1.1;
}

.dt-timestamp-stack small {
  width: 32px;
  flex: 0 0 32px;
  text-transform: uppercase;
  font-weight: 900;
}

.dt-timestamp-stack strong {
  min-width: 0;
  color: #0f172a;
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.dt-timestamp-stack em {
  color: #16a34a;
  font-style: normal;
}

.dt-duration-cell {
  color: #334155;
  font-weight: 800;
  white-space: nowrap;
}

.dt-type-badge {
  border-radius: 999px;
  padding: 0.32rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 900;
}

.dt-reason-cell {
  display: grid;
  gap: 5px;
  min-width: 180px;
}

.dt-reason-main {
  color: #0f172a;
  font-size: 0.84rem;
  font-weight: 900;
  line-height: 1.15;
}

.dt-assignee-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  padding: 3px 8px 3px 4px;
  border-radius: 999px;
  background: #eef6ff;
  color: #0f172a;
  box-shadow: inset 0 0 0 1px rgba(10, 132, 255, 0.12);
}

.dt-assignee-presence .dt-assignee-avatar {
  width: 24px;
  height: 24px;
  font-size: 0.72rem;
  object-fit: cover;
}

.dt-assignee-presence .presence-dot {
  width: 8px;
  height: 8px;
  right: -1px;
  bottom: -1px;
  border-width: 1px;
}

.dt-assignee-copy {
  display: grid;
  min-width: 0;
  line-height: 1.05;
}

.dt-assignee-copy strong {
  overflow: hidden;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dt-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}

.dt-row-actions .btn {
  min-height: 32px;
  border-radius: 999px !important;
  padding: 0.3rem 0.62rem !important;
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.dt-row-actions .dtShareFeedBtn {
  width: 32px;
  min-width: 32px;
  padding: 0 !important;
}

@media (max-width: 767.98px) {
  body.ws-workstation-page #dtTableView .app-data-table thead th {
    padding: 8px 10px !important;
    font-size: 0.68rem !important;
  }

  body.ws-workstation-page #dtTableView .app-data-table tbody tr.dtRow td {
    padding: 7px 9px !important;
  }

  .dt-timestamp-stack {
    min-width: 132px;
  }

  .dt-timestamp-stack strong {
    font-size: 0.76rem;
  }

  .dt-row-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    min-width: 128px;
  }
}

#timeline .vis-current-time,
body.ws-workstation-page #dtTimeline .vis-current-time {
  width: 2px !important;
  background-color: color-mix(in srgb, var(--app-primary-color, #794bff) 82%, #ffffff) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-primary-color, #794bff) 12%, transparent) !important;
}

.dt-event-context-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.dt-event-context-grid.is-multi {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dt-event-context-grid > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.78);
}

.dt-event-context-grid small {
  display: block;
  margin-bottom: 4px;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dt-event-context-grid strong {
  color: #0f172a;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.2;
}

.dt-event-context-grid em {
  color: #16a34a;
  font-style: normal;
}

.dt-split-slider {
  height: 24px !important;
  accent-color: var(--app-primary-color, #794bff) !important;
}

.dt-split-slider::-webkit-slider-thumb {
  width: 34px;
  height: 34px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--app-primary-color, #794bff);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--app-primary-color, #794bff) 38%, transparent);
}

.dt-split-slider::-moz-range-thumb {
  width: 32px;
  height: 32px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--app-primary-color, #794bff);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--app-primary-color, #794bff) 38%, transparent);
}

.dt-row-actions .dtAssignBtn {
  background: color-mix(in srgb, var(--app-primary-color, #794bff) 14%, #ffffff) !important;
  border: 1px solid color-mix(in srgb, var(--app-primary-color, #794bff) 28%, #ffffff) !important;
  color: var(--app-primary-color, #794bff) !important;
  box-shadow: none !important;
}

.dt-row-actions .dtAssignBtn:hover,
.dt-row-actions .dtAssignBtn:focus {
  background: var(--app-primary-color, #794bff) !important;
  color: #ffffff !important;
}

@media (max-width: 767.98px) {
  .dt-event-context-grid,
  .dt-event-context-grid.is-multi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Unified configurable action color */
.btn-primary,
.btn-info,
.btn-success,
.btn-primary:hover,
.btn-primary:focus,
.btn-info:hover,
.btn-info:focus,
.btn-success:hover,
.btn-success:focus,
.app-chat-fab,
.app-chat-send,
.app-chat-row-actions button.is-active,
.app-chat-row-actions button:hover,
.app-chat-row-actions button:focus,
.app-chat-picker-tools button.active,
.app-chat-message.is-mine .app-chat-bubble,
body.ws-workstation-page .order-related-toggle,
.shift-calendar-nav .btn-primary,
.scheduler-nav .btn-primary,
.raw-events-shift-nav .btn-primary {
  background: var(--app-primary-color, #111827) !important;
  border-color: var(--app-primary-color, #111827) !important;
  color: #fff !important;
}

.btn-outline-primary {
  color: var(--app-primary-color, #111827) !important;
  border-color: color-mix(in srgb, var(--app-primary-color, #111827) 42%, white) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background: var(--app-primary-color, #111827) !important;
  border-color: var(--app-primary-color, #111827) !important;
  color: #fff !important;
}

.ws-feed-post.is-pinned {
  border-color: color-mix(in srgb, var(--app-primary-color, #111827) 24%, white) !important;
  background: linear-gradient(180deg, color-mix(in srgb, var(--app-primary-color, #111827) 10%, white), #fff 58%) !important;
}

.dt-split-slider {
  accent-color: var(--app-primary-color, #111827) !important;
  height: 24px !important;
}

.dt-split-slider::-webkit-slider-thumb,
.dt-split-slider::-moz-range-thumb {
  width: 34px !important;
  height: 34px !important;
  background: var(--app-primary-color, #111827) !important;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--app-primary-color, #111827) 26%, transparent) !important;
}

.app-chat-row.is-selected > i,
.app-chat-unread-divider {
  color: var(--app-primary-color, #111827) !important;
}

.app-chat-unread-divider::before,
.app-chat-unread-divider::after {
  background: color-mix(in srgb, var(--app-primary-color, #111827) 22%, transparent) !important;
}

.app-chat-unread-divider span,
.app-chat-row-actions button.is-active,
.app-chat-row-actions button:hover,
.app-chat-row-actions button:focus {
  background: color-mix(in srgb, var(--app-primary-color, #111827) 10%, white) !important;
  color: var(--app-primary-color, #111827) !important;
}
/* Layout polish: workstation materials/tasks, orders filters, permissions, standard pages */
.task-templates-page,
.bom-page,
.raw-events-page,
.access-control-page,
.permission-matrix-page,
.audit-trail-page,
.services-page,
main.app-page,
main.raw-events-page,
main.audit-trail-page {
  --page-header-gap: 14px;
}

.task-templates-page .app-page-header,
.bom-page .app-page-header,
.raw-events-page .app-page-header,
.access-control-page .app-page-header,
.permission-matrix-page .app-page-header,
.audit-trail-page .app-page-header,
.services-page .app-page-header {
  margin-bottom: var(--page-header-gap) !important;
}

.task-templates-page .app-page-title,
.bom-page .app-page-title,
.raw-events-page .app-page-title,
.access-control-page .app-page-title,
.permission-matrix-page .app-page-title,
.audit-trail-page .app-page-title,
.services-page .app-page-title,
main.app-page .app-page-title {
  margin-bottom: 0 !important;
  font-size: clamp(1.78rem, 1.25rem + 0.7vw, 2.15rem) !important;
  line-height: 1.08;
}

.task-templates-page .app-table-tools,
.bom-page .app-table-tools,
.raw-events-page .raw-events-filters,
.access-control-page .access-control-top,
.permission-matrix-page .permission-matrix-card,
.audit-trail-page .audit-filter-card,
.services-page #runtime-services {
  margin-top: 16px;
}

.ws-materials-layout,
body.ws-workstation-page .ws-tasks-layout {
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  width: 100%;
}

.ws-material-bom-shell {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.ws-material-bom-shell .ws-material-bom-panel {
  flex: 1 1 auto;
  min-width: 0;
}

.ws-material-bom-shell .app-badge {
  flex: 0 0 auto;
  margin-top: 8px;
}

.ws-material-bom-panel.is-collapsed {
  flex: 0 0 44px;
}

#wsMaterialItemSelect,
#wsMaterialItemSelect + .select2 .select2-selection,
#wsMaterialBomSelect + .select2 .select2-selection {
  border-radius: 16px !important;
}

#wsMaterialsPanel .ws-material-consumed-card,
#wsMaterialsPanel .ws-material-consumed-row,
#wsMaterialsPanel .ws-material-consumption-wrap tbody tr,
#wsMaterialsPanel .ws-material-consumption-wrap tbody tr:hover,
#wsMaterialsPanel .ws-material-consumption-wrap tbody tr:hover td {
  background: transparent !important;
}

body.ws-workstation-page .ws-task-list-panel,
body.ws-workstation-page .ws-task-list,
body.ws-workstation-page .ws-task-card {
  width: 100%;
  min-width: 0;
}

.order-filter-panel {
  padding: 18px;
}

.order-filter-layout {
  display: grid;
  grid-template-columns: minmax(260px, auto) minmax(220px, 320px) minmax(360px, 1fr);
  gap: 18px;
  align-items: end;
}

.order-filter-label {
  display: block;
  margin-bottom: 8px;
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.order-filter-time {
  grid-column: 1;
}

.order-time-toolbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
}

.order-period-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-width: 0;
  order: 2;
}

.order-period-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  order: 1;
}

.order-period-nav .btn {
  min-height: 38px;
  border-radius: 14px;
}

.order-period-label {
  order: 2;
  min-height: 20px;
  margin-top: 0;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.order-custom-range {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 0;
  align-self: end;
}

.order-custom-range label {
  display: block;
  margin-bottom: 4px;
  color: var(--app-muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.order-filter-status {
  grid-column: 3;
  justify-self: end;
  width: min(100%, 620px);
  align-self: end;
}

.order-filter-statuses {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.order-filter-statuses .form-check-inline {
  margin: 0 !important;
}

.permission-type-tabs {
  --permission-tab-count: 1;
  --permission-tab-index: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--permission-tab-count), minmax(78px, 1fr));
  gap: 0;
  padding: 5px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 18px;
  background: rgba(226, 232, 240, 0.64);
}

.permission-type-tabs::before {
  content: "";
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: calc((100% - 10px) / var(--permission-tab-count));
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  transform: translateX(calc(var(--permission-tab-index) * 100%));
  transition: transform 0.22s ease;
}

.permission-type-tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 14px;
  color: var(--app-muted);
  font-weight: 900;
  text-decoration: none !important;
}

.permission-type-tab.active {
  color: var(--app-text);
}

@media (max-width: 1100px) {
  .order-filter-layout,
  .ws-materials-layout,
  body.ws-workstation-page .ws-tasks-layout {
    grid-template-columns: 1fr;
  }

  .order-filter-status {
    grid-column: auto;
    justify-self: stretch;
    width: 100%;
  }

  .order-filter-time,
  .order-custom-range {
    grid-column: auto;
  }

  .order-custom-range {
    max-width: 420px;
  }

  .order-filter-statuses {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .order-time-toolbar,
  .order-period-nav,
  .order-range-tabs,
  #orderRangeTabs.order-range-tabs {
    width: 100%;
  }

  .order-period-nav {
    justify-content: space-between;
  }

  .order-custom-range {
    max-width: none;
    grid-template-columns: 1fr;
  }
}

/* Final layout pass: task tab and AllOrders filters */
body.ws-workstation-page .ws-tasks-panel,
body.ws-workstation-page .ws-tasks-layout {
  width: 100% !important;
  max-width: none !important;
}

body.ws-workstation-page .ws-tasks-layout {
  display: grid !important;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr) !important;
  align-items: stretch !important;
  gap: 16px !important;
}

body.ws-workstation-page .ws-task-filter-panel {
  width: 100% !important;
  max-width: 320px !important;
}

body.ws-workstation-page .ws-task-list,
body.ws-workstation-page .ws-task-list-panel {
  justify-self: stretch !important;
  align-self: stretch !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}

body.ws-workstation-page .ws-task-card {
  width: 100% !important;
  max-width: none !important;
}

.order-range-tabs {
  --order-range-index: 0;
  position: relative !important;
  display: inline-flex !important;
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 0 !important;
  gap: 0 !important;
  order: 1;
}

#orderRangeTabs.order-range-tabs {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  min-height: 48px !important;
  pointer-events: auto !important;
}

.order-range-tabs label,
.order-range-tabs .btn {
  position: relative !important;
  z-index: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 78px !important;
  padding: 0 14px !important;
  white-space: nowrap !important;
}

.order-range-tabs input[type="radio"],
.order-range-tabs input[type="checkbox"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 1px !important;
  max-width: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.order-range-tabs label.active,
.order-range-tabs .btn.active {
  background: transparent !important;
  color: var(--app-text) !important;
}

.order-filter-status.scheduler-status-filter {
  justify-self: end;
  width: min(100%, 640px);
}

.order-filter-statuses.status-inline-wrap {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(120px, max-content)) !important;
  align-items: center !important;
  justify-content: start !important;
  gap: 10px 18px !important;
}

.order-filter-statuses.status-inline-wrap .form-check-inline {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 34px;
  margin: 0 !important;
  gap: 8px;
}

.order-filter-statuses.status-inline-wrap .form-check-input {
  flex: 0 0 auto;
  margin: 0 !important;
}

.order-filter-statuses.status-inline-wrap .form-check-label {
  margin: 0 !important;
  color: var(--app-text);
  font-weight: 700;
  line-height: 1;
}

@media (max-width: 1100px) {
  body.ws-workstation-page .ws-tasks-layout {
    grid-template-columns: 1fr !important;
  }

  body.ws-workstation-page .ws-task-filter-panel {
    max-width: none !important;
  }

  .order-filter-status.scheduler-status-filter {
    justify-self: stretch;
    width: 100%;
  }

  .order-filter-statuses.status-inline-wrap {
    grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)) !important;
    justify-content: stretch !important;
  }
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-primary-tools,
.scheduler-primary-tools {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  min-width: 0 !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-period-row,
.scheduler-period-row {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  min-width: 0 !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-period-label,
.scheduler-period-label {
  color: var(--app-muted) !important;
  font-size: 0.86rem !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-view-toggle {
  width: auto !important;
}

body.has-app-sidebar main.scheduler-page-wrap .scheduler-view-toggle .btn,
.scheduler-view-toggle .btn {
  min-width: 78px !important;
  padding-inline: 14px !important;
}

.scheduler-header-label-empty {
  min-height: 40px;
}

@media (max-width: 640px) {
  .order-period-row,
  body.has-app-sidebar main.scheduler-page-wrap .scheduler-period-row,
  .scheduler-period-row {
    align-items: flex-start !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .order-period-label,
  body.has-app-sidebar main.scheduler-page-wrap .scheduler-period-label,
  .scheduler-period-label {
    white-space: normal !important;
  }
}

.ws-tags-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: none;
}

.app-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  max-width: 100%;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.app-badge-neutral {
  background: #fff;
  color: #334155;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.app-badge-success {
  background: rgba(22, 163, 74, 0.13);
  color: #15803d;
}

.app-badge-danger {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.app-badge-warning {
  background: rgba(245, 158, 11, 0.14);
  color: #92400e;
}

.ws-tags-button:hover,
.ws-tags-button:focus {
  text-decoration: none;
  box-shadow: none;
}

.ws-tags-modal .modal-content {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: var(--app-surface-solid);
  box-shadow: var(--app-shadow-strong);
  overflow: hidden;
}

.ws-tags-modal .modal-header {
  align-items: center;
  border-bottom: 1px solid var(--app-border);
  background: rgba(245, 246, 248, 0.72);
}

@media (max-width: 991.98px) {
  .traceability-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .traceability-filter-grid {
    grid-template-columns: 1fr;
  }

  .traceability-tabs {
    width: 100%;
  }

  .traceability-tabs .btn {
    flex: 1 1 0;
    justify-content: center;
    padding-inline: 8px;
  }
}

.ws-tags-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 12px;
}

.ws-tags-template-filter {
  margin-bottom: 12px;
}

.ws-tags-template-filter .ws-filter-segments {
  width: 100%;
  max-width: 720px;
}

.ws-tags-template-filter .ws-filter-segment {
  min-width: 0;
  white-space: nowrap;
}

.ws-tag-card {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: #fff;
  padding: 12px;
  color: var(--app-text);
  text-align: left;
  box-shadow: var(--app-shadow-soft);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.ws-tag-card:hover,
.ws-tag-card:focus {
  border-color: rgba(121, 75, 255, 0.42);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
  outline: none;
}

.ws-tag-card.is-out-of-range {
  border-color: rgba(220, 53, 69, 0.32);
  background: linear-gradient(180deg, rgba(220, 53, 69, 0.09), rgba(255, 255, 255, 0.98));
}

.ws-tag-card-head,
.ws-tag-card-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ws-tag-card-head strong {
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.ws-tag-card-value {
  display: block;
  margin: 11px 0 8px;
  color: var(--app-text);
  font-size: clamp(1.05rem, 2.1vw, 1.45rem);
  font-weight: 950;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.ws-tag-card-meta {
  color: var(--app-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.ws-tag-card-head .app-badge {
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.ws-tag-card-meta span {
  min-width: 0;
}

.ws-tag-range {
  display: inline-flex;
  margin-top: 9px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--app-muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.ws-tag-history-panel {
  margin-top: 16px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: #fff;
  box-shadow: var(--app-shadow-soft);
  overflow: hidden;
}

.ws-tag-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--app-border);
  background: rgba(245, 246, 248, 0.82);
}

.ws-tag-history-head small {
  display: block;
  color: var(--app-muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ws-tag-history-head strong {
  display: block;
  color: var(--app-text);
  font-size: 1rem;
  font-weight: 900;
}

.ws-tag-history-body {
  padding: 14px;
}

.ws-tag-history-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.ws-tag-history-scope {
  flex: 0 1 420px;
  min-width: min(100%, 420px);
}

.ws-tag-history-custom {
  display: inline-grid;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) auto;
  gap: 8px;
  align-items: center;
  flex: 1 1 420px;
}

.ws-tag-history-window {
  margin-bottom: 10px;
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.ws-tag-history-chart {
  position: relative;
  width: 100%;
  min-height: 250px;
  margin-bottom: 0;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: linear-gradient(180deg, rgba(121, 75, 255, 0.05), rgba(255, 255, 255, 0.94));
  overflow: hidden;
  padding: 12px;
  cursor: crosshair;
}

.ws-tag-history-chart canvas {
  display: block;
  width: 100%;
  min-height: 220px;
}

.ws-tag-history-dragbox {
  position: absolute;
  z-index: 4;
  border: 1px solid color-mix(in srgb, var(--app-primary-color) 48%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--app-primary-color) 13%, transparent);
  pointer-events: none;
}

.opc-tag-rule-panel {
  grid-column: 1 / -1;
  min-width: 0;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: #fff;
  padding: 16px;
  box-shadow: var(--app-shadow-soft);
}

.integration-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: var(--app-page-content-gap, 18px);
}

.integration-catalog-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: #fff;
  box-shadow: var(--app-shadow-soft);
}

.integration-catalog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.integration-catalog-head h5 {
  margin: 0;
  color: var(--app-text);
  font-size: 1rem;
  font-weight: 950;
}

.integration-catalog-card p {
  margin: 0;
  color: var(--app-muted);
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.45;
}

.integration-catalog-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.integration-catalog-meta span {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: rgba(245, 246, 248, 0.76);
}

.integration-catalog-meta small,
.integration-catalog-meta strong {
  display: block;
  overflow-wrap: anywhere;
}

.integration-catalog-meta small {
  color: var(--app-muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.integration-catalog-meta strong {
  color: var(--app-text);
  font-size: 0.84rem;
  font-weight: 850;
}

.integration-console {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: #fff;
  box-shadow: var(--app-shadow-soft);
}

.integration-console-head,
.integration-connector-card,
.integration-connector-main,
.integration-connector-actions,
.integration-connector-status {
  display: flex;
  align-items: center;
}

.integration-console-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.integration-console-head h5 {
  margin: 0;
  color: var(--app-text);
  font-size: 1rem;
  font-weight: 950;
}

.integration-connector-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.integration-connector-card {
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: rgba(245, 246, 248, 0.52);
}

.integration-connector-main {
  min-width: 0;
  flex: 1 1 auto;
  gap: 10px;
}

.integration-connector-main h5 {
  margin: 0;
  color: var(--app-text);
  font-size: 0.98rem;
  font-weight: 950;
}

.integration-connector-main p,
.integration-connector-status small {
  margin: 2px 0 0;
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.integration-connector-status {
  flex: 0 1 260px;
  align-items: flex-end;
  flex-direction: column;
  min-width: 0;
  text-align: right;
}

.integration-connector-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.integration-connector-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.integration-connector-actions .btn-icon {
  justify-content: center;
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  gap: 0;
}

.integration-connector-actions .btn-primary.btn-sm,
.integration-connector-actions .btn-danger.btn-sm {
  justify-content: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
}

.integration-connector-actions .btn-primary.btn-sm {
  color: #4338ca !important;
  background: rgba(99, 102, 241, 0.12) !important;
  border: 1px solid rgba(99, 102, 241, 0.18) !important;
}

.integration-connector-actions .btn-danger.btn-sm {
  color: #b91c1c !important;
  background: rgba(239, 68, 68, 0.12) !important;
  border: 1px solid rgba(239, 68, 68, 0.18) !important;
}

.integration-switch-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
}

.integration-switch-field > span {
  color: var(--app-text);
  font-size: 0.86rem;
  font-weight: 800;
}

.integration-connector-modal .modal-dialog {
  max-width: min(980px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  margin: 12px auto;
}

.integration-connector-modal .modal-content,
.integration-connector-modal form {
  max-height: calc(100vh - 24px);
  min-height: 0;
}

.integration-connector-modal form {
  display: flex;
  flex-direction: column;
}

.integration-connector-modal .modal-body {
  min-height: 0;
  overflow-y: auto;
}

.integration-connector-modal .modal-footer {
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
}

.integration-form-section {
  margin-top: 6px;
  padding: 14px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: rgba(245, 246, 248, 0.44);
}

.integration-form-section-title {
  margin-bottom: 12px;
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.integration-connector-modal .modal-content {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  box-shadow: var(--app-shadow-soft);
}

.integration-test-result {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--app-radius);
  font-size: 0.86rem;
  font-weight: 800;
}

.integration-test-result.is-success {
  border: 1px solid rgba(34, 197, 94, 0.28);
  background: rgba(34, 197, 94, 0.1);
  color: #166534;
}

.integration-test-result.is-danger {
  border: 1px solid rgba(239, 68, 68, 0.24);
  background: rgba(239, 68, 68, 0.1);
  color: #991b1b;
}

.integration-test-result.is-info {
  border: 1px solid color-mix(in srgb, var(--app-primary-color) 24%, transparent);
  background: color-mix(in srgb, var(--app-primary-color) 9%, transparent);
  color: var(--app-primary-color);
}

.integration-rules-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.integration-export-rule-list {
  display: grid;
  gap: 10px;
}

.integration-export-rule-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: rgba(245, 246, 248, 0.46);
}

.integration-export-rules-modal .modal-dialog {
  max-width: min(1040px, calc(100vw - 22px));
}

.integration-export-rules-modal .modal-content,
.integration-export-rules-modal .modal-body {
  min-width: 0;
  overflow-x: hidden;
}

.integration-export-rules-modal *,
.integration-connector-modal * {
  box-sizing: border-box;
}

.integration-export-rules-modal .modal-body {
  max-height: min(76vh, 760px);
  overflow-y: auto;
}

.integration-rule-grid {
  min-width: 0;
  max-width: 100%;
  margin-right: -6px;
  margin-left: -6px;
}

.integration-rule-grid > [class*="col-"] {
  min-width: 0;
  padding-right: 6px;
  padding-left: 6px;
}

.integration-rule-grid .form-control,
.integration-rule-grid .select2-container,
.integration-rule-grid .select2-selection {
  min-width: 0;
  max-width: 100%;
  width: 100% !important;
}

.integration-rule-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 4px;
}

.integration-rule-filter-grid > div {
  min-width: 0;
}

.integration-rule-filter-grid label,
.integration-rule-grid label {
  display: block;
  margin-bottom: 5px;
  color: var(--app-muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.integration-export-rule-head,
.integration-rule-actions {
  display: flex;
  align-items: center;
}

.integration-export-rule-head {
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 10px;
}

.integration-export-rule-head strong {
  color: var(--app-text);
  font-size: 0.96rem;
  font-weight: 950;
}

.integration-rule-actions {
  flex: 0 0 auto;
  gap: 8px;
}

.integration-rule-active > span {
  font-size: 0.78rem;
  font-weight: 900;
}

.integration-log-filters {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: #fff;
  box-shadow: var(--app-shadow-soft);
}

.integration-log-filters .card-body {
  padding: 14px;
}

.integration-log-table.is-loading tbody {
  opacity: 0.55;
}

.integration-log-target {
  max-width: 360px;
  overflow-wrap: anywhere;
}

.integration-direction-group {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: rgba(245, 246, 248, 0.42);
}

.integration-direction-title,
.integration-rule-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.integration-direction-title {
  justify-content: flex-start;
  margin: 0 0 10px;
  color: var(--app-muted);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.integration-direction-list {
  display: grid;
  gap: 10px;
}

.integration-api-key-modal .modal-content {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  box-shadow: var(--app-shadow-soft);
}

.integration-api-key-value {
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: rgba(245, 246, 248, 0.72);
  color: var(--app-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.84rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.runtime-readonly-config {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.runtime-readonly-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  background: rgba(245, 246, 248, 0.58);
}

.runtime-readonly-row span {
  color: var(--app-muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.runtime-readonly-row strong {
  min-width: 0;
  color: var(--app-text);
  font-size: 0.82rem;
  font-weight: 850;
  text-align: right;
  overflow-wrap: anywhere;
}

.runtime-cron-row {
  display: grid;
  grid-template-columns: minmax(96px, 0.32fr) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.runtime-cron-row label {
  font-weight: 850;
  text-align: left;
}

.runtime-cron-group .runtime-save-config {
  min-width: 74px;
}

.services-page .runtime-card .app-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.services-page .runtime-card .app-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.app-page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.event-schedule-rules-card {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  overflow: visible;
  box-shadow: none;
}

body.event-type-form-page > .select2-container--open,
body.asset-hierarchy-body > .select2-container--open {
  z-index: 2100 !important;
}

.event-schedule-rules-list {
  display: grid;
  gap: 10px;
}

.app-system-event-banner {
  grid-column: 1 / -1;
  color: var(--app-muted);
  background: color-mix(in srgb, var(--app-primary-color, #794bff) 6%, #ffffff);
  border-color: color-mix(in srgb, var(--app-primary-color, #794bff) 18%, #e5e7eb);
}

.event-schedule-rule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: rgba(245, 246, 248, 0.62);
}

.event-schedule-rule-main {
  display: grid;
  grid-template-columns: minmax(112px, 0.22fr) minmax(180px, 0.38fr) minmax(260px, 1fr);
  align-items: end;
  gap: 10px;
  min-width: 0;
}

.event-schedule-rule-main .form-group,
.event-schedule-rule-main .select2-container {
  min-width: 0;
}

.event-schedule-rule-main .select2-selection__choice {
  max-width: min(100%, 220px);
  overflow: hidden;
}

.event-schedule-rule-main .select2-selection__choice__display {
  max-width: 174px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-schedule-rule-row .task-switch {
  min-height: 42px;
  justify-content: flex-start;
}

.asset-hierarchy-page {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 72px);
  min-height: 560px;
  overflow: hidden;
}

.asset-hierarchy-shell {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--app-border);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.04), rgba(255, 255, 255, 0.92)),
    #fff;
  overflow: hidden;
}

.asset-hierarchy-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--app-border);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(14px);
}

.asset-hierarchy-toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.asset-hierarchy-link-hint {
  padding: 7px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--app-primary-color, #794bff) 12%, #fff);
  color: var(--app-primary-color, #794bff);
  font-weight: 850;
  font-size: 0.78rem;
}

.asset-hierarchy-workspace {
  position: relative;
  display: block;
  flex: 1 1 auto;
  min-height: 0;
}

.asset-hierarchy-canvas-wrap {
  position: relative;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  cursor: grab;
  background-color: #111827;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.16) 1px, transparent 0);
  background-size: 26px 26px;
}

.asset-hierarchy-canvas-wrap,
.asset-hierarchy-canvas,
.asset-hierarchy-lanes,
.asset-hierarchy-node {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.asset-hierarchy-canvas-wrap {
  touch-action: none;
}

.asset-hierarchy-canvas-wrap.is-panning {
  cursor: grabbing;
}

.asset-hierarchy-canvas-wrap.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.52);
  backdrop-filter: blur(4px);
  z-index: 20;
}

.asset-hierarchy-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  padding: 28px;
  transform-origin: top left;
  transition: none;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

.asset-hierarchy-canvas.uses-css-zoom {
  transition: none;
  transform: none !important;
}

.asset-hierarchy-edges {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.asset-hierarchy-edge {
  fill: none;
  stroke: color-mix(in srgb, var(--app-primary-color, #794bff) 44%, #cbd5e1);
  stroke-width: 2.2;
  stroke-linecap: round;
}

.asset-hierarchy-lanes {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 64px;
  width: max-content;
  min-width: 0;
}

.asset-hierarchy-lane {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: center;
  gap: 14px;
  width: fit-content;
  min-width: 0;
  padding-top: 34px;
}

.asset-hierarchy-lane-title {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  width: max-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--app-border);
  color: var(--app-muted);
  font-size: 0.7rem;
  font-weight: 950;
  text-transform: uppercase;
}

.asset-hierarchy-site-node {
  min-height: 104px;
  border-color: color-mix(in srgb, var(--app-primary-color, #794bff) 26%, #e2e8f0);
  background: color-mix(in srgb, var(--app-primary-color, #794bff) 5%, #ffffff);
}

.asset-hierarchy-site-mark {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: var(--app-primary-color, #794bff);
  background: color-mix(in srgb, var(--app-primary-color, #794bff) 12%, #ffffff);
}

.asset-hierarchy-node {
  position: relative;
  display: grid;
  gap: 4px;
  width: 230px;
  min-width: 230px;
  flex: 0 0 230px;
  min-height: 112px;
  padding: 14px 14px 12px;
  border: 1px solid rgba(226, 232, 240, 0.96);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--app-text);
  text-align: left;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  touch-action: none;
  overflow: hidden;
}

.asset-hierarchy-node:hover {
  border-color: color-mix(in srgb, var(--app-primary-color, #794bff) 44%, #fff);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.12);
  transform: none;
}

.asset-hierarchy-node.is-hold-pending {
  border-color: color-mix(in srgb, var(--app-primary-color, #794bff) 62%, #ffffff);
}

@keyframes assetHierarchyWiggle {
  0%, 100% { rotate: -0.65deg; }
  50% { rotate: 0.65deg; }
}

.asset-hierarchy-canvas-wrap.is-drag-mode .asset-hierarchy-node[data-asset-id] {
  cursor: grab;
  animation: assetHierarchyWiggle 0.22s ease-in-out infinite;
}

.asset-hierarchy-canvas-wrap.is-drag-mode .asset-hierarchy-lane:nth-child(even) .asset-hierarchy-node[data-asset-id]:nth-child(even),
.asset-hierarchy-canvas-wrap.is-drag-mode .asset-hierarchy-lane:nth-child(odd) .asset-hierarchy-node[data-asset-id]:nth-child(odd) {
  animation-direction: reverse;
  animation-delay: -0.11s;
}

.asset-hierarchy-canvas-wrap.is-drag-mode .asset-hierarchy-node.is-dragging {
  cursor: grabbing;
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .asset-hierarchy-canvas-wrap.is-drag-mode .asset-hierarchy-node[data-asset-id] {
    animation: none;
  }
}

.asset-hierarchy-node.is-dragging {
  opacity: 0.56;
}

.asset-hierarchy-drag-ghost {
  position: fixed !important;
  z-index: 2200;
  pointer-events: none !important;
  margin: 0 !important;
  opacity: 0.9;
  transform: rotate(1.5deg) scale(1.02) !important;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.24) !important;
}

.asset-hierarchy-node.is-drop-target {
  border-color: var(--app-primary-color, #794bff);
  outline: 4px solid color-mix(in srgb, var(--app-primary-color, #794bff) 18%, transparent);
}

.asset-hierarchy-node.is-inactive {
  opacity: 0.72;
}

.asset-hierarchy-node.is-missing-tags {
  border-style: dashed;
  border-color: rgba(239, 68, 68, 0.4);
}

.asset-hierarchy-node.is-draft {
  border-color: color-mix(in srgb, var(--app-primary-color, #794bff) 48%, #ffffff);
  border-style: dashed;
  background: color-mix(in srgb, var(--app-primary-color, #794bff) 7%, #ffffff);
}

.asset-hierarchy-node.is-selected {
  border: 2px solid var(--app-primary-color, #794bff) !important;
  outline: 4px solid color-mix(in srgb, var(--app-primary-color, #794bff) 28%, transparent);
  background: color-mix(in srgb, var(--app-primary-color, #794bff) 7%, #ffffff);
  transform: none;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.92),
    0 0 0 7px color-mix(in srgb, var(--app-primary-color, #794bff) 72%, transparent),
    0 24px 56px rgba(15, 23, 42, 0.22);
}

.asset-hierarchy-node-status {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #94a3b8;
}

.asset-hierarchy-node-status.is-active {
  background: #22c55e;
}

.asset-hierarchy-node-title {
  min-width: 0;
  padding-right: 18px;
  font-weight: 950;
  line-height: 1.14;
  overflow-wrap: anywhere;
}

.asset-hierarchy-node-code,
.asset-hierarchy-node-meta {
  color: var(--app-muted);
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.asset-hierarchy-node-tags {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.asset-hierarchy-node-tags span {
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #475569;
  font-size: 0.66rem;
  font-weight: 850;
}

.asset-hierarchy-node-tags span.is-empty {
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
}

.asset-hierarchy-editor {
  position: fixed;
  top: 116px;
  right: 24px;
  z-index: 1060;
  width: min(420px, calc(100vw - 32px));
  bottom: 92px;
  max-height: none;
  border: 1px solid var(--app-border);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  min-width: 0;
  overscroll-behavior: contain;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateX(16px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.asset-hierarchy-editor.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.asset-hierarchy-editor-empty {
  display: none;
  place-items: center;
  align-content: center;
  gap: 8px;
  height: 100%;
  min-height: 360px;
  padding: 24px;
  text-align: center;
  color: var(--app-muted);
}

.asset-hierarchy-editor-empty i {
  font-size: 2rem;
  color: var(--app-primary-color, #794bff);
}

.asset-hierarchy-editor-form {
  display: grid;
  gap: 12px;
  padding: 18px;
  min-width: 0;
}

.asset-hierarchy-editor .form-group,
.asset-hierarchy-editor .form-control,
.asset-hierarchy-editor .select2-container,
.asset-hierarchy-editor .select2-selection,
.asset-hierarchy-editor .select2-selection__rendered {
  min-width: 0 !important;
  max-width: 100%;
}

.asset-hierarchy-tag-editor-modal .select2-container--open {
  z-index: 1095;
}

.asset-hierarchy-editor .select2-dropdown,
.asset-hierarchy-select2-dropdown {
  min-width: 220px;
}

.asset-hierarchy-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.asset-hierarchy-editor-head h2 {
  margin: 0;
  color: var(--app-text);
  font-size: 1.05rem;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.asset-hierarchy-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.asset-hierarchy-tags-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: rgba(245, 246, 248, 0.52);
}

.asset-hierarchy-tags-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--app-muted);
  font-size: 0.74rem;
}

.asset-hierarchy-tags-head strong {
  color: var(--app-text);
  text-transform: uppercase;
}

.asset-hierarchy-tags-list {
  display: grid;
  gap: 7px;
}

.asset-hierarchy-tag-chip {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--app-border);
}

.asset-hierarchy-tag-chip strong {
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.asset-hierarchy-tag-chip small {
  color: var(--app-muted);
  font-weight: 750;
}

.asset-hierarchy-tag-chip.connected {
  border-color: rgba(34, 197, 94, 0.24);
  background: rgba(34, 197, 94, 0.06);
}

.asset-hierarchy-editor-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--app-border);
}

.asset-hierarchy-editor-secondary-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.asset-hierarchy-action-spacer {
  flex: 1 1 auto;
}

.asset-hierarchy-new-asset {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
}

.asset-hierarchy-tag-modal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 11px 12px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: #fff;
}

.asset-hierarchy-tag-modal-row:last-child {
  margin-bottom: 0;
}

.asset-hierarchy-tag-modal-row > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.asset-hierarchy-tag-modal-row strong,
.asset-hierarchy-tag-modal-row span,
.asset-hierarchy-tag-modal-row small {
  overflow-wrap: anywhere;
}

.asset-hierarchy-tag-modal-actions {
  display: flex !important;
  grid-template-columns: none !important;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.asset-hierarchy-tag-editor-modal .modal-content,
.asset-hierarchy-tags-modal .modal-content,
.asset-hierarchy-choice-modal .modal-content {
  overflow: hidden;
  border: 0;
  border-radius: 18px;
}

.asset-hierarchy-choice-modal,
.asset-hierarchy-tags-modal,
.asset-hierarchy-tag-editor-modal {
  z-index: 1090;
}

.asset-hierarchy-tag-editor-body {
  max-height: min(68vh, 660px);
  overflow-x: hidden;
  overflow-y: auto;
}

.asset-hierarchy-tag-editor-body .form-group {
  min-width: 0;
}

.asset-hierarchy-tag-script {
  min-height: 126px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
}

.asset-hierarchy-tag-modal-row span,
.asset-hierarchy-tag-modal-row small {
  color: var(--app-muted);
  font-weight: 750;
}

@media (max-width: 991.98px) {
  .event-schedule-rule-main,
  .asset-hierarchy-editor-grid {
    grid-template-columns: 1fr;
  }

  .asset-hierarchy-editor {
    top: 92px;
    right: 12px;
    bottom: 82px;
    width: calc(100vw - 24px);
    max-height: none;
  }

  .asset-hierarchy-canvas {
    min-width: 720px;
  }

  .asset-hierarchy-page {
    height: calc(100dvh - 60px);
  }

  .asset-hierarchy-new-asset {
    right: 12px;
    bottom: 12px;
  }
}

.integration-rule-section {
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: rgba(245, 246, 248, 0.42);
}

.integration-rule-section + .integration-rule-section,
.integration-rule-section + .integration-inbound-api-panel {
  margin-top: 14px;
}

.integration-rule-section-head {
  margin-bottom: 12px;
}

.integration-rule-section-head h6 {
  margin: 0;
  font-weight: 950;
}

.integration-log-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.integration-log-meta {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: rgba(245, 246, 248, 0.48);
}

.integration-log-meta {
  padding: 10px 12px;
}

.integration-log-meta small {
  display: block;
  color: var(--app-muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.integration-log-meta strong {
  display: block;
  color: var(--app-text);
  font-size: 0.88rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.integration-log-json-panel {
  margin-top: 12px;
}

.integration-log-json-panel pre {
  max-height: 170px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  color: #e5edf7;
  background: #0f172a;
  font-size: 0.78rem;
}

.integration-inbound-api-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--app-border);
}

.integration-inbound-api-head,
.integration-api-client-row,
.integration-api-client-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.integration-inbound-api-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.integration-inbound-api-head h6 {
  margin: 0;
  font-weight: 950;
}

.integration-api-client-form {
  display: grid;
  grid-template-columns: minmax(190px, 280px) minmax(0, 1fr);
  align-items: stretch;
  margin-bottom: 12px;
}

.integration-api-client-inputs,
.integration-api-client-selector {
  min-width: 0;
}

.integration-api-client-inputs {
  display: grid;
  gap: 8px;
}

.integration-api-client-selector {
  display: grid;
  align-content: start;
  gap: 7px;
}

.integration-api-client-selector label {
  margin: 0;
  color: var(--app-muted);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.integration-api-client-inputs label {
  display: block;
  margin: 0 0 5px;
  color: var(--app-muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.integration-api-client-form .form-control,
.integration-api-client-form .select2-container,
.integration-api-client-form .select2-selection {
  min-width: 0;
  width: 100% !important;
}

.integration-api-client-form .select2-selection__choice {
  max-width: min(100%, 280px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integration-export-rules-modal .select2-selection__choice {
  max-width: min(100%, 340px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integration-export-rules-modal .select2-selection__choice__display {
  max-width: 290px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.integration-export-rules-modal .select2-selection__rendered,
.integration-api-client-form .select2-selection__rendered {
  max-width: 100%;
  white-space: normal;
}

.integration-api-client-form .select2-selection__choice__display {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.integration-dynamic-switch-field {
  min-height: 44px;
  align-items: center;
}

.integration-api-client-row {
  justify-content: space-between;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: #fff;
}

.integration-api-client-row > div,
.integration-api-client-main {
  min-width: 0;
}

.integration-api-client-main {
  display: grid;
  gap: 6px;
}

.integration-api-client-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.integration-api-client-row strong,
.integration-api-client-row small {
  display: block;
  overflow-wrap: anywhere;
}

.integration-api-client-row small {
  color: var(--app-muted);
}

.integration-api-client-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.integration-api-key-badge {
  text-transform: none;
}

.integration-api-key-badge span {
  color: var(--app-muted);
  font-weight: 850;
}

.integration-api-key-badge strong {
  display: inline;
  color: var(--app-text);
  font-weight: 950;
  overflow-wrap: anywhere;
}

.integration-api-client-hint {
  margin: 8px 2px 0;
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.traceability-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.traceability-panel {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.traceability-page .app-table-tools {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 0;
}

.traceability-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.traceability-filter-grid label {
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.traceability-toolbar-row,
.traceability-table-controls,
.traceability-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.traceability-toolbar-row {
  justify-content: space-between;
  flex-wrap: wrap;
}

.traceability-table-controls {
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}

.traceability-tabs .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  min-width: 156px !important;
}

.traceability-panel {
  min-height: 0;
}

.traceability-page .app-table-wrap {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  max-height: calc(100dvh - 315px);
  overflow: auto;
}

.traceability-page .app-table-search {
  width: min(260px, 100%);
  min-width: 0;
}

.traceability-page .select2-container {
  min-width: 0;
}

.traceability-page .select2-container--default .select2-selection--multiple {
  min-height: 42px !important;
  align-items: flex-start !important;
  padding: 5px 8px !important;
}

.traceability-page .select2-container--default .select2-selection--multiple .select2-selection__rendered {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 4px !important;
  max-height: 78px;
  overflow-y: auto;
}

.traceability-page .select2-container--default .select2-selection--multiple .select2-selection__choice {
  max-width: min(100%, 240px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.traceability-page .select2-container--default .select2-selection--multiple .select2-search--inline {
  min-width: 90px;
}

.traceability-page .select2-container--default .select2-selection--multiple .select2-search__field {
  min-height: 26px !important;
  margin-top: 3px !important;
}

.traceability-page th[data-sort] {
  cursor: pointer;
  user-select: none;
}

.traceability-page th[data-sort]::after {
  content: "\f0dc";
  display: inline-block;
  margin-left: 6px;
  color: rgba(100, 116, 139, 0.38);
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.72rem;
}

.traceability-page th[data-sort].is-sorted::after {
  color: var(--app-primary-color);
}

.traceability-page th[data-sort].is-sorted[data-sort-dir="asc"]::after {
  content: "\f0de";
}

.traceability-page th[data-sort].is-sorted[data-sort-dir="desc"]::after {
  content: "\f0dd";
}

.traceability-page-info {
  min-width: 70px;
}

.traceability-table th,
.traceability-table td {
  vertical-align: middle;
  white-space: nowrap;
}

.traceability-material-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.traceability-material-cell small {
  color: var(--app-muted);
  line-height: 1.25;
}

.traceability-quantity-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.traceability-source-chip small {
  display: block;
  color: var(--app-muted);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.1;
}

@media (max-width: 991.98px) {
  .traceability-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .traceability-page .app-table-wrap {
    max-height: calc(100dvh - 390px);
  }
}

@media (max-width: 575.98px) {
  .traceability-filter-grid {
    grid-template-columns: 1fr;
  }

  .traceability-tabs,
  .traceability-table-controls,
  .traceability-page .app-table-search {
    width: 100%;
  }

  .traceability-tabs .btn {
    flex: 1 1 0;
    justify-content: center;
    padding-inline: 8px;
  }

  .traceability-table-controls {
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
  }

}

.integration-api-endpoints {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.integration-api-endpoint-card {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: rgba(245, 246, 248, 0.58);
}

.integration-api-endpoint-card summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
}

.integration-api-endpoint-card summary strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integration-copy-endpoint {
  flex: 0 0 auto;
  margin-left: auto;
}

.integration-api-endpoint-card p {
  margin: 0;
  padding: 0 12px 10px;
  color: var(--app-muted);
}

.integration-api-payload-box {
  margin: 0 12px 12px;
  overflow: hidden;
  border-radius: 10px;
  background: #0f172a;
}

.integration-api-endpoint-payload-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px 6px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.12);
  color: #cbd5e1;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.integration-api-endpoint-payload-head .btn {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.integration-api-endpoint-card pre {
  max-height: 180px;
  margin: 0;
  padding: 10px;
  overflow: auto;
  border-radius: 0;
  background: transparent;
  color: #e5edf7;
  font-size: 0.76rem;
}

@media (max-width: 991.98px) {
  .integration-connector-list {
    grid-template-columns: 1fr;
  }

  .integration-connector-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .integration-connector-status {
    align-items: flex-start;
    flex: 1 1 auto;
    text-align: left;
  }

  .integration-log-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .runtime-cron-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .integrations-page .app-page-header,
  .integration-console-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .integrations-page .app-page-header .btn,
  .integration-console-head .btn,
  .integration-connector-actions,
  .integration-connector-actions .btn {
    width: 100%;
  }

  .integration-api-client-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .integration-rule-filter-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .integration-connector-actions .btn {
    justify-content: center;
  }

  .integration-connector-actions .btn-primary.btn-sm,
  .integration-connector-actions .btn-danger.btn-sm {
    width: 38px;
    min-width: 38px;
  }

  .integration-rules-toolbar .btn,
  .integration-log-filters .btn {
    width: 100%;
  }

  .integration-log-detail-grid {
    grid-template-columns: 1fr;
  }
}

.opc-tag-rule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.opc-tag-rule-head > div {
  min-width: min(100%, 240px);
}

.opc-tag-rule-list {
  display: grid;
  gap: 10px;
}

.opc-tag-rule-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.8fr) minmax(220px, 1.2fr) auto auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: rgba(245, 246, 248, 0.52);
}

.opc-tag-rule-row label {
  color: var(--app-muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.tag-rule-value-wrap.is-disabled {
  opacity: 0.5;
}

.tag-rule-enabled {
  min-height: 42px;
  align-items: center;
  white-space: nowrap;
}

@media (max-width: 991.98px) {
  .opc-tag-rule-row {
    grid-template-columns: 1fr 1fr;
  }

  .tag-rule-enabled,
  .opc-tag-rule-row [data-tag-rule-remove] {
    justify-self: start;
  }
}

@media (max-width: 575.98px) {
  .ws-tags-button span {
    display: none;
  }

  .ws-tag-history-custom {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .ws-tag-history-scope {
    width: 100%;
  }

  .opc-tag-rule-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .opc-tag-rule-row {
    grid-template-columns: 1fr;
  }
}
