/* Miswitch overlays on Velzon / Bootstrap 5 */
.table tbody tr[data-id],
.table tbody tr[data-order-id],
.table tbody tr[data-quote-id],
.table tbody tr[data-po-id],
.table tbody tr[data-workflow-id] { cursor: pointer; }

#view-orders .search-box,
#view-materials .search-box,
#view-quotes .search-box,
#view-purchase-orders .search-box,
#view-api .search-box,
#view-api-tokens .search-box,
#view-workflows .search-box {
  max-width: none;
  width: 100%;
}

#orders-daterange,
#quotes-daterange,
#po-daterange {
  cursor: pointer;
}

.th-sort,
.orders-th-sort {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.th-sort .sort-icon,
.orders-th-sort .sort-icon {
  margin-left: 0.15rem;
  font-size: 14px;
  color: var(--vz-secondary-color, #878a99);
  vertical-align: middle;
}

.th-sort.is-active .sort-icon,
.orders-th-sort.is-active .sort-icon {
  color: var(--vz-primary, #405189);
}

/* Velzon .table-card uses -1rem margin for padded card-body; our tables sit in p-0. */
.card-body.p-0 > .table-card {
  margin: 0;
}

.table-card th:first-child,
.table-card td:first-child {
  padding-left: 1.25rem;
}

.table-card th:last-child,
.table-card td:last-child {
  padding-right: 1.25rem;
}

.cell-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.cell-title .badge {
  flex: 0 0 auto;
  width: max-content;
  max-width: 100%;
}

.cell-title .text-muted { font-size: 12px; }

.search-box {
  position: relative;
  max-width: 380px;
}

.search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--vz-secondary-color, #878a99);
}

.search-box .form-control.search { padding-left: 2rem; }

.offcanvas.offcanvas-end { width: min(460px, 100%); }

.auth-one-bg {
  background-image: url("/vendor/velzon/images/auth-one-bg.jpg");
  background-size: cover;
  background-position: center;
}

#nav-users[hidden],
#nav-api-tokens[hidden],
.view[hidden],
.header-user-avatar [hidden],
.profile-avatar [hidden] { display: none !important; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.vertical-overlay {
  cursor: pointer;
}

/* Keep Small Hover sidebar above page content while expanded */
.apex-charts { min-height: 230px; }

#dashboard-overview-chart { min-height: 350px; }

.progress-sm { height: 6px; }

#coming-soon-icon-wrap { width: 4.5rem; height: 4.5rem; }

#drawer.calc-drawer.offcanvas-end,
#order-item-drawer.order-item-drawer,
#quote-item-drawer.order-item-drawer { width: min(640px, 100%); }

#orders-detail-heading,
#quotes-detail-heading {
  font-size: 1.15rem;
}

.rule-row .form-label { font-size: 12px; }

.entity-var-picker { position: relative; }

.entity-var-results {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 8;
  max-height: 240px;
  overflow: auto;
  margin-top: 4px;
  padding: 0.25rem 0;
  background: var(--vz-secondary-bg, #fff);
  border: 1px solid var(--vz-border-color, #e9ebec);
  border-radius: 0.3rem;
  box-shadow: 0 0.5rem 1rem rgba(15, 23, 42, 0.08);
}

.entity-var-result {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.5rem 0.85rem;
}

.entity-var-result:hover,
.entity-var-result:focus {
  background: var(--vz-light, #f3f6f9);
}

.entity-var-result-empty {
  padding: 0.65rem 0.85rem;
  font-size: 13px;
}

.formula-var-picker .entity-var-results {
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: 4px;
}

.job-product-picked {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.header-user-avatar {
  display: inline-flex;
  width: 32px;
  height: 32px;
}

.header-user-avatar img,
.header-user-avatar .header-profile-user {
  width: 32px;
  height: 32px;
  object-fit: cover;
}

.profile-avatar {
  position: relative;
  width: 7rem;
  height: 7rem;
}

.profile-avatar-img {
  width: 7rem;
  height: 7rem;
  object-fit: cover;
}

.profile-avatar .avatar-title {
  width: 7rem;
  height: 7rem;
  font-size: 2.4rem;
}

.form-switch-lg .form-check-input {
  width: 2.75em;
  height: 1.4em;
}

#kanbanboard.tasks-board {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  align-items: flex-start;
}

#kanbanboard .tasks-list {
  min-width: 280px;
  flex: 1 1 280px;
}

#kanbanboard .tasks-wrapper {
  min-height: 380px;
  max-height: calc(100vh - 280px);
  overflow: auto;
}

#kanbanboard .tasks-box { cursor: pointer; }

.order-item-row { text-align: left; }

.api-method-badge {
  min-width: 4.4rem;
  font-family: var(--vz-font-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-align: center;
}

.api-docs-path {
  font-size: 13px;
  word-break: break-all;
}

.api-docs-code {
  background: var(--vz-tertiary-bg, #f3f6f9);
  border: 1px solid var(--vz-border-color, #e9ebec);
  border-radius: 0.4rem;
  padding: 0.7rem 0.85rem;
  font-size: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
}

.api-docs-accordion .accordion-item {
  border: 1px solid var(--vz-border-color, #e9ebec);
  border-radius: 0.4rem;
  margin-bottom: 0.65rem;
  overflow: hidden;
}

.api-docs-accordion .accordion-button {
  background: var(--vz-secondary-bg, #fff);
  box-shadow: none;
  font-size: 14px;
}

.api-docs-accordion .accordion-button:not(.collapsed) {
  background: var(--vz-tertiary-bg, #f3f6f9);
  color: inherit;
  box-shadow: none;
}

.api-docs-accordion .accordion-button:focus {
  box-shadow: none;
}

.api-endpoint {
  padding: 1rem 1.15rem;
  border-top: 1px solid var(--vz-border-color, #e9ebec);
}

.api-endpoint:first-child {
  border-top: 0;
}

.api-token-prefix {
  font-size: 12px;
}

#api-token-secret {
  font-size: 12px;
}

body.wf-editor-open .page-content {
  padding-bottom: 0.5rem;
}

body.wf-editor-open #view-workflows {
  height: calc(100vh - 78px);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#workflows-editor-page {
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

#workflows-editor-page:not([hidden]) {
  display: flex;
}

.wf-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.wf-toolbar-name {
  max-width: 280px;
}

.wf-studio {
  --wf-drawer: 320px;
  --wf-footer: 220px;
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--wf-drawer);
  border: 1px solid var(--vz-border-color, #e9ebec);
  border-radius: 0.4rem;
  overflow: hidden;
  background: var(--vz-secondary-bg, #fff);
}

body.wf-running .wf-studio::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #f06548;
  z-index: 30;
  pointer-events: none;
}

body.wf-running .wf-library,
body.wf-running .wf-canvas .drawflow-node,
body.wf-running .wf-canvas svg.connection,
body.wf-running .wf-canvas .drawflow-delete {
  pointer-events: none !important;
}

.wf-row-running td:first-child {
  box-shadow: inset 4px 0 0 #f06548;
}

.wf-run-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #f06548;
  vertical-align: middle;
  animation: wf-run-pulse 1.2s ease-in-out infinite;
}

@keyframes wf-run-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

body.wf-drawer-collapsed .wf-studio { --wf-drawer: 0px; }
body.wf-footer-closed .wf-studio { --wf-footer: 0px; }

.wf-stage {
  display: grid;
  grid-template-rows: minmax(0, 1fr) var(--wf-footer);
  min-width: 0;
  min-height: 0;
}

.wf-drawer {
  background: var(--vz-tertiary-bg, #f3f6f9);
  border-left: 1px solid var(--vz-border-color, #e9ebec);
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.wf-drawer-collapsed .wf-drawer { display: none; }

.wf-drawer-tabs {
  display: flex;
  border-bottom: 1px solid var(--vz-border-color, #e9ebec);
  flex-shrink: 0;
}

.wf-drawer-tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 0.65rem 0.5rem;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--vz-secondary-color, #878a99);
}

.wf-drawer-tab.active {
  color: var(--vz-primary, #405189);
  box-shadow: inset 0 -2px 0 var(--vz-primary, #405189);
  background: var(--vz-secondary-bg, #fff);
}

.wf-drawer-search {
  padding: 0.65rem 0.75rem 0;
  flex-shrink: 0;
}

.wf-drawer-scroll {
  flex: 1;
  overflow: auto;
  padding: 0.75rem;
}

.wf-lib-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--vz-secondary-color, #878a99);
  margin: 0.5rem 0 0.4rem;
}

.wf-lib-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  border: 1px dashed var(--vz-border-color, #e9ebec);
  background: var(--vz-secondary-bg, #fff);
  border-radius: 0.4rem;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.4rem;
  text-align: left;
  font-size: 13px;
  cursor: grab;
}

.wf-lib-item:hover {
  border-color: var(--vz-primary, #405189);
  color: var(--vz-primary, #405189);
}

.wf-lib-item i { font-size: 16px; }

.wf-canvas {
  position: relative;
  overflow: hidden;
  min-height: 0;
  background-color: var(--vz-body-bg, #f3f3f9);
  background-image: radial-gradient(var(--vz-border-color, #dbe0e4) 1px, transparent 1px);
  background-size: 18px 18px;
}

#wf-drawflow,
#wf-drawflow.parent-drawflow {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
  touch-action: none;
}

#wf-drawflow .drawflow {
  background: transparent;
}

#wf-drawflow .drawflow .drawflow-node {
  display: flex;
  align-items: center;
  background: var(--vz-secondary-bg, #fff);
  color: var(--vz-body-color, #212529);
  width: 220px;
  min-height: 72px;
  border: 1px solid var(--vz-border-color, #e9ebec);
  border-radius: 0.55rem;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  padding: 0.55rem 0.7rem;
  transition: none;
  will-change: left, top;
}

#wf-drawflow .drawflow .drawflow-node.selected {
  background: var(--vz-secondary-bg, #fff);
  border-color: var(--vz-primary, #405189);
  box-shadow: 0 0 0 3px rgba(64, 81, 137, 0.16);
}

#wf-drawflow .drawflow .drawflow-node.wf-node-held {
  border-color: #f7b84b;
}

#wf-drawflow .drawflow .drawflow-node .input,
#wf-drawflow .drawflow .drawflow-node .output {
  width: 12px;
  height: 12px;
  background: #fff;
  border: 2px solid #405189;
  margin-bottom: 0;
  top: 22px;
}

#wf-drawflow .drawflow .drawflow-node .input { left: -21px; }
#wf-drawflow .drawflow .drawflow-node .output { right: -3px; }

#wf-drawflow .drawflow .connection .main-path {
  stroke: var(--wf-edge, #405189);
  stroke-width: 2.4px;
}

#wf-drawflow .drawflow .connection .main-path:hover,
#wf-drawflow .drawflow .connection .main-path.selected {
  stroke: #f06548;
}

#wf-drawflow .drawflow .connection.wf-edge-conditional .main-path,
#wf-drawflow .drawflow .connection.wf-edge-hold .main-path {
  stroke-dasharray: 7 5;
}

#wf-drawflow .drawflow-delete {
  background: #f06548;
  border-color: #fff;
  width: 22px;
  height: 22px;
  line-height: 18px;
  font-size: 14px;
}

.wf-df-node {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  width: 100%;
}

.wf-df-copy {
  min-width: 0;
  flex: 1;
}

.wf-df-icon {
  width: 32px;
  height: 32px;
  border-radius: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

.wf-accent-primary .wf-df-icon { background: rgba(64, 81, 137, 0.12); color: #405189; }
.wf-accent-warning .wf-df-icon { background: rgba(247, 184, 75, 0.18); color: #cc8b17; }
.wf-accent-info .wf-df-icon { background: rgba(41, 156, 219, 0.16); color: #2385ba; }
.wf-accent-secondary .wf-df-icon { background: rgba(135, 138, 153, 0.16); color: #5c6070; }
.wf-accent-success .wf-df-icon { background: rgba(10, 179, 156, 0.16); color: #0ab39c; }
.wf-accent-danger .wf-df-icon { background: rgba(240, 101, 72, 0.14); color: #f06548; }

.wf-df-kicker {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--vz-secondary-color, #878a99);
}

.wf-df-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.wf-df-count {
  margin-left: auto;
  min-width: 1.55rem;
  height: 1.45rem;
  padding: 0 0.35rem;
  border-radius: 0.3rem;
  background: var(--vz-tertiary-bg, #f3f6f9);
  color: var(--vz-secondary-color, #878a99);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.wf-df-count.has-jobs {
  background: rgba(64, 81, 137, 0.14);
  color: #405189;
}

.wf-hold-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f7b84b;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(247, 184, 75, 0.25);
}

.wf-icon-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.25rem;
}

.wf-icon-pick {
  border: 1px solid var(--vz-border-color, #e9ebec);
  background: var(--vz-secondary-bg, #fff);
  border-radius: 0.3rem;
  height: 32px;
  color: inherit;
}

.wf-icon-pick.is-on {
  border-color: var(--vz-primary, #405189);
  color: var(--vz-primary, #405189);
}

.wf-color-grid {
  display: flex;
  gap: 0.35rem;
}

.wf-color-pick {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
}

.wf-color-pick.is-on {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--vz-primary, #405189);
}

.wf-footer {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--vz-secondary-bg, #fff);
  border-top: 1px solid var(--vz-border-color, #e9ebec);
}

body.wf-footer-closed .wf-footer { display: none; }

.wf-footer-resize {
  height: 7px;
  flex-shrink: 0;
  cursor: ns-resize;
  background: transparent;
  touch-action: none;
}

.wf-footer-resize:hover,
body.wf-footer-resizing .wf-footer-resize {
  background: rgba(64, 81, 137, 0.35);
}

body.wf-footer-resizing { cursor: ns-resize; user-select: none; }

.wf-footer-panes {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

body.wf-monitor-collapsed .wf-footer-panes { grid-template-columns: 0 minmax(0, 1fr); }
body.wf-log-collapsed .wf-footer-panes { grid-template-columns: minmax(0, 1fr) 0; }
body.wf-monitor-collapsed.wf-log-collapsed .wf-footer-panes { grid-template-columns: 0 0; }

.wf-monitor,
.wf-log {
  background: var(--vz-secondary-bg, #fff);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.wf-log {
  border-left: 1px solid var(--vz-border-color, #e9ebec);
}

body.wf-monitor-collapsed .wf-monitor { display: none; }
body.wf-log-collapsed .wf-log { display: none; }
body.wf-monitor-collapsed .wf-log { border-left: 0; }

.wf-monitor-head {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  min-height: 36px;
  flex-shrink: 0;
}

.wf-monitor-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--vz-secondary-color, #878a99);
}

.wf-monitor-body,
.wf-log-body,
.wf-problems-body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 0.55rem 0.55rem;
}

.wf-problems-btn.has-problems {
  color: #f06548;
  border-color: rgba(240, 101, 72, 0.35);
}

.wf-problems-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  margin-left: 0.2rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #f06548;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.wf-problems {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  max-height: 42%;
  display: flex;
  flex-direction: column;
  background: var(--vz-secondary-bg, #fff);
  border-bottom: 1px solid rgba(240, 101, 72, 0.35);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.wf-problems-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  min-height: 36px;
  flex-shrink: 0;
  background: rgba(240, 101, 72, 0.08);
}

.wf-problem-row {
  cursor: pointer;
}

.wf-problem-row:hover {
  background: rgba(240, 101, 72, 0.08);
}

body.wf-problems-open .wf-problems { display: flex; }

.wf-file-row {
  cursor: pointer;
}

.wf-file-row.is-on {
  background: rgba(64, 81, 137, 0.08);
}

.wf-ctx {
  position: fixed;
  z-index: 1080;
  min-width: 180px;
  padding: 0.35rem 0;
  background: var(--vz-secondary-bg, #fff);
  border: 1px solid var(--vz-border-color, #e9ebec);
  border-radius: 0.4rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.wf-ctx button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.4rem 0.85rem;
  font-size: 13px;
}

.wf-ctx button:hover { background: var(--vz-tertiary-bg, #f3f6f9); }

@media (max-width: 575.98px) {
  .wf-studio {
    grid-template-columns: 1fr;
  }
  .wf-stage { min-height: 360px; }
  .wf-drawer { min-height: 240px; border-left: 0; border-top: 1px solid var(--vz-border-color, #e9ebec); }
  body.wf-drawer-collapsed .wf-drawer { display: flex; }
}

