/* ============================================================
   SmartFabX — hub-assembly.css
   Assembly viewer (screen), compose / assembly list UI
   Split from hub.css on 2026-08-31.
   ============================================================ */

/* ══ ASSEMBLY VIEWER MODAL (avm) — portrait suite popup ════════ */
#asmViewerModal {
  padding: 16px;
  align-items: center;
  justify-content: center;
}
.avm-container {
  /* Portrait fabrication sheet (~A4+), not a soft dashboard card */
  width: min(980px, calc(100vw - 28px));
  max-width: 980px;
  height: min(96vh, calc(100vh - 28px));
  max-height: calc(100vh - 28px);
  display: flex;
  flex-direction: column;
  background: #eef1f4;
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.18),
    0 28px 64px rgba(15, 23, 42, 0.28);
}

/* Header — fabrication toolbar */
.avm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 0 16px;
  height: 48px;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  flex-shrink: 0;
  gap: 14px;
  border-bottom: 2px solid #0ea5e9;
}
.avm-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-width: 0;
}
.avm-header-left svg {
  color: #38bdf8;
  flex-shrink: 0;
}
.avm-header-sep { color: #475569; margin: 0 2px; }
.avm-header-name {
  color: #f8fafc;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.avm-header-actions {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 5px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.45);
}
.avm-action-btn {
  height: 30px;
  padding: 0 14px;
  border: none;
  border-right: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 0;
  background: transparent;
  color: #e2e8f0;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  white-space: nowrap;
}
.avm-action-btn:last-child { border-right: none; }
.avm-action-btn:hover { background: rgba(148, 163, 184, 0.18); color: #fff; }
.avm-action-btn--primary {
  background: #0f766e;
  color: #fff;
}
.avm-action-btn--primary:hover { background: #0d9488; color: #fff; }
.avm-action-btn--close {
  width: auto;
  min-width: 64px;
  padding: 0 14px;
  text-align: center;
  background: rgba(15, 23, 42, 0.35);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}
.avm-action-btn--close:hover { background: #9f1239; color: #fff; }

/* Footer — Save + Print */
.avm-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  background: #fff;
  border-top: 1px solid #d1d5db;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
}
.avm-footer-btn {
  height: 38px;
  min-width: 120px;
  padding: 0 20px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.avm-footer-btn:active { transform: translateY(1px); }
.avm-footer-btn--save {
  background: #374151;
  border-color: #1f2937;
  color: #fff;
}
.avm-footer-btn--save:hover { background: #1f2937; }
.avm-footer-btn--print {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}
.avm-footer-btn--print:hover { background: #111827; }
.avm-footer-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* Body */
.avm-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background:
    linear-gradient(180deg, #dbe3ec 0%, #eef1f4 36px, #eef1f4 100%);
}

/* ── Assembly viewer pages (screen + print) ── */
.avm-page {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* Author display:flex above would otherwise override the HTML hidden attribute */
.avm-page[hidden],
.avm-detail-extra-stack[hidden] {
  display: none !important;
}
.avm-page-tag {
  font-family: var(--font-heading);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
  padding: 0 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.avm-page-tag::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #cbd5e1;
}
.avm-page--bom {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid #cbd5e1;
}

/* Unit info (compact, above drawings) */
.avm-unit-block--compact {
  padding: 8px 10px 9px;
  gap: 7px;
}
.avm-unit-block--compact .avm-info-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.avm-unit-block--compact .avm-info-row {
  min-height: 32px;
  padding: 4px 7px;
}
.avm-unit-block--compact .avm-info-value {
  font-size: 11.5px;
}

/* Page 1 sheet: elevation + packed blow-ups (fit what we can; overflow → next page) */
.avm-drawings-sheet {
  display: grid !important;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, 1.2fr);
  gap: 12px;
  min-height: 0;
  flex: 0 0 auto;
  visibility: visible !important;
  align-items: start;
}
@media (max-width: 1200px) {
  .avm-drawings-sheet {
    grid-template-columns: 1fr;
  }
}

.avm-elevation-card,
.avm-detail-card {
  background: #fff;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  padding: 8px 10px 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: none;
  min-height: 0;
}
.avm-elevation-card--hero {
  min-height: 0;
}
.avm-detail-card--blowups {
  min-height: 0;
  /* Blow-ups must not clip Right/H jambs (Inside/Outside chrome + CAD). */
  overflow: visible;
  overflow-x: auto;
}
.avm-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 2px 6px;
  border-bottom: 1.5px solid #0f172a;
}
.avm-card-label {
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #0f172a;
}
.avm-card-hint {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.avm-elevation-inner, .avm-template-inner {
  flex: 1;
  min-height: 0;
  overflow: visible;
}
.avm-elevation-inner {
  display: flex;
  align-items: stretch;
}
.avm-drawings-sheet--elev-only {
  grid-template-columns: 1fr !important;
  max-width: 100%;
}
.avm-drawings-sheet--elev-plan {
  grid-template-columns: 1fr !important;
  max-width: 100%;
}
.avm-drawings-sheet--elev-only .avm-elevation-card--hero,
.avm-drawings-sheet--elev-plan .avm-elevation-card--hero {
  min-height: 0;
  width: 100%;
}
.avm-plan-card {
  background: #fff;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}
.avm-plan-card[hidden] {
  display: none !important;
}
.avm-plan-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  background: #fff;
  min-height: 110px;
  border: 1px solid #e2e8f0;
}
.avm-plan-inner svg {
  max-width: 100%;
  height: auto;
  display: block;
}
html:not(.sfx-show-pos-details) #asmViewPageDetails,
html:not(.sfx-show-pos-details) #asmViewPageDetailsExtra,
html:not(.sfx-show-pos-details) .avm-page--details {
  display: none !important;
}
.avm-elevation-stage {
  width: 100%;
  min-height: clamp(220px, 32vh, 420px);
  border: 1px solid #e2e8f0;
  border-radius: 0;
  background: #fff;
  padding: 10px 12px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}
.avm-elevation-stage svg {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: clamp(220px, 42vh, 460px) !important;
  margin: auto !important;
  overflow: visible;
  background: transparent;
}
.avm-template-inner {
  font-size: 11px;
  color: #475569;
  border-top: 1px solid #f1f5f9;
  padding-top: 8px;
}

/* Blow-up details — V column left, H 2-col grid right (assembly page 2). */
.avm-detail-blowup-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: flex-start;
  align-items: flex-start;
  justify-content: flex-start;
  flex: 0 0 auto;
  min-height: 0;
}
.avm-detail-blowup-grid--readable,
.avm-detail-blowup-grid--packed {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: flex-start;
  align-items: flex-start;
  justify-content: flex-start;
  min-height: 0;
}
.avm-detail-blowup-grid--vh {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  justify-items: start;
  min-height: 0;
  overflow-x: auto;
  overflow-y: visible;
}
.avm-blowup-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  overflow: visible;
}
.avm-blowup-group-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #334155;
  margin: 0;
  padding: 0 2px;
}
.avm-blowup-group-title--v { color: #1d4ed8; }
.avm-blowup-group-title--h { color: #b45309; }
/* V = vertical level → one card per row (stacked column) */
.avm-blowup-v-col {
  display: grid;
  grid-auto-flow: row;
  grid-template-columns: max-content;
  gap: 10px;
  align-content: start;
  justify-items: stretch;
  min-width: 0;
}
/* H = horizontal level → column-based 2-col grid */
.avm-blowup-h-grid {
  display: grid;
  grid-auto-flow: row;
  grid-template-columns: repeat(2, max-content);
  gap: 10px;
  align-content: start;
  justify-content: start;
  min-width: 0;
  overflow: visible;
}
@media (max-width: 900px) {
  .avm-detail-blowup-grid--vh {
    grid-template-columns: 1fr;
  }
  .avm-blowup-h-grid {
    grid-template-columns: repeat(2, minmax(0, max-content));
  }
}
.avm-detail-blowup-grid--page2 {
  min-height: 0;
}
.avm-detail-extra-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 0 0 auto;
  min-height: 0;
}
.avm-detail-extra-chunk--break {
  page-break-before: always;
  break-before: page;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 2px dashed #94a3b8;
}
.avm-page--details {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 2px dashed #94a3b8;
}
.avm-page--details .avm-detail-card--blowups {
  min-height: 0;
}
.avm-page--details-extra {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 2px dashed #94a3b8;
}
.avm-detail-card--extra-page {
  min-height: 0;
}
.avm-detail-item {
  border: 1px solid #94a3b8;
  border-radius: 4px;
  background: #fff;
  padding: 6px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 0;
  /* Never clip CAD + dims + Inside/Outside chrome (H2 was cut off) */
  overflow: visible;
  flex: 0 0 auto;
  width: max-content;
  max-width: none;
  box-sizing: border-box;
}
.avm-detail-item--mid {
  border-color: #f59e0b;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.25);
}
.avm-detail-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.avm-detail-mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1.5px solid #1d4ed8;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2px;
  line-height: 1;
}
.avm-detail-mark--h {
  border-color: #b45309;
  color: #b45309;
  background: #fffbeb;
}
.avm-detail-item-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  color: #0f172a;
  line-height: 1.2;
  min-width: 0;
}
.avm-detail-item-code {
  font-size: 10.5px;
  color: #64748b;
  font-weight: 600;
}
.avm-detail-item-scale {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.avm-detail-item-dims {
  font-size: 9px;
  color: #1e3a5f;
  font-weight: 700;
  letter-spacing: 0.15px;
  line-height: 1.25;
}
.avm-detail-stage {
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 2px;
  padding: 4px;
  overflow: visible;
  width: max-content;
  max-width: none;
  box-sizing: border-box;
}
.avm-detail-blowup-grid--page2 .avm-detail-stage {
  min-height: 0;
}
.avm-detail-stage svg {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  margin: auto;
}
/* Uniform CAD scale: never let CSS stretch one detail larger than another */
.avm-detail-stage--uniform {
  overflow: visible;
}
.avm-detail-stage--uniform svg {
  max-width: none !important;
  max-height: none !important;
  flex-shrink: 0;
}
/* Inside / Outside chrome beside the drawing — never overlaid on CAD dims */
.avm-detail-stage-io {
  display: flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: none;
  box-sizing: border-box;
  overflow: visible;
}
.avm-detail-stage-io--x {
  flex-direction: row;
}
.avm-detail-stage-io--y {
  flex-direction: column;
}
.avm-detail-stage-io .avm-detail-stage {
  flex: 0 0 auto;
}
.avm-io-tag {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 7px;
  border-radius: 3px;
  border: 1.5px solid #94a3b8;
  background: #f8fafc;
  color: #334155;
  white-space: nowrap;
  line-height: 1.1;
  writing-mode: horizontal-tb;
}
.avm-detail-stage-io--y .avm-io-tag {
  align-self: center;
}
.avm-io-tag--in {
  border-color: #1d4ed8;
  color: #1d4ed8;
  background: #eff6ff;
}
.avm-io-tag--out {
  border-color: #b45309;
  color: #b45309;
  background: #fffbeb;
}
.avm-detail-empty {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 180px;
  border: 1px dashed #cbd5e1;
  border-radius: 4px;
  background: #f8fafc;
  color: #94a3b8;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
}

/* Legacy class kept for inject fallback */
.avm-drawings-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.9fr);
  gap: 14px;
  min-height: 420px;
}
.avm-detail-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-height: 400px;
}

@media (max-height: 860px) {
  .avm-header {
    height: 46px;
    padding: 0 14px;
  }
  .avm-action-btn {
    height: 26px;
    padding: 0 8px;
    font-size: 10px;
  }
  .avm-body {
    padding: 10px 12px 14px;
    gap: 12px;
  }
  .avm-elevation-card--hero,
  .avm-detail-card--blowups {
    min-height: 0;
  }
  .avm-elevation-stage {
    min-height: clamp(160px, 22vh, 280px);
  }
  .avm-elevation-stage svg {
    max-height: clamp(140px, 20vh, 260px) !important;
  }
}
.avm-elevation-empty {
  width: 100%;
  min-height: 280px;
  border: 1px dashed #cbd5e1;
  border-radius: 4px;
  background: #f8fafc;
  color: #94a3b8;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
}
.avm-template-meta {
  font-size: 11px;
  color: #334155;
  font-weight: 600;
  line-height: 1.35;
}


/* 2) Unit information */
.avm-unit-block {
  background: #fff;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: none;
}
.avm-unit-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 6px;
  border-bottom: 1.5px solid #0f172a;
}
.avm-card-label--unit {
  display: none;
}
.avm-dim-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: #0f172a;
}
.avm-dim-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border: 1px solid #94a3b8;
  border-radius: 0;
  background: #f1f5f9;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  color: #0f172a;
}
.avm-dim-chip span {
  color: #64748b;
  font-weight: 700;
  font-family: var(--font-heading), sans-serif;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.avm-info-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  flex-shrink: 0;
}
.avm-info-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  border: 1px solid #94a3b8;
  border-radius: 2px;
  overflow: hidden;
}
@media (max-width: 1100px) {
  .avm-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .avm-info-grid {
    grid-template-columns: 1fr;
  }
}
.avm-info-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 8px;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  min-height: 36px;
}
.avm-info-row:nth-child(5n) {
  border-right: none;
}
.avm-info-row:nth-child(4n) {
  border-right: 1px solid #e2e8f0;
}
@media (max-width: 1100px) {
  .avm-info-row:nth-child(5n),
  .avm-info-row:nth-child(4n) {
    border-right: 1px solid #e2e8f0;
  }
  .avm-info-row:nth-child(2n) {
    border-right: none;
  }
}
.avm-info-label {
  color: #64748b;
  min-width: 0;
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.avm-info-value {
  color: #0f172a;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.25;
}
.avm-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 7px;
  border: 1px solid #86efac;
  background: #f0fdf4;
  color: #166534;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.4;
}
.avm-status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #16a34a;
  flex-shrink: 0;
}
.avm-status-badge--new {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #64748b;
}
.avm-status-badge--new::before { background: #94a3b8; }

.avm-glass-card {
  background: #fff;
  border: 1px solid #94a3b8;
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.avm-bom-area > .avm-glass-card {
  border: none;
  border-radius: 0;
  border-bottom: 1px solid #cbd5e1;
}

/* Section bars */
.avm-section-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 0;
  flex-shrink: 0;
  border: none;
  border-bottom: 1px solid #cbd5e1;
  color: #0f172a;
}
.avm-section-bar--glass  { background: #eef2f6; color: #0f172a; border-left: 3px solid #64748b; }
.avm-section-bar--frame  { background: #f0fdf4; color: #14532d; border-left: 3px solid #15803d; }
.avm-section-bar--bead   { background: #f8fafc; color: #0f172a; border-left: 3px solid #0ea5e9; }
.avm-section-bar--acc    { background: #fffbeb; color: #0f172a; border-left: 3px solid #d97706; }
.avm-section-bar--article { background: #f5f3ff; color: #0f172a; border-left: 3px solid #7c3aed; }
.avm-section-bar--hw     { background: #f8fafc; color: #0f172a; border-left: 3px solid #475569; }
.avm-section-bar--gasket { background: #f0f9ff; color: #0f172a; border-left: 3px solid #0284c7; }
.avm-section-bar--cfg    { background: #fffbeb; color: #0f172a; border-left: 3px solid #ca8a04; }
.avm-split-row td {
  background: #e8eef4 !important;
  font-family: var(--font-heading, inherit);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1e293b;
  padding: 6px 10px !important;
  border-bottom: 1px solid #94a3b8;
  border-top: 1px solid #cbd5e1;
}
.avm-glass-card .avm-table { table-layout: auto; }
.avm-glass-total td { background: #f8fafc !important; border-top: 1px solid #94a3b8; }
.avm-section-count {
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  background: rgba(255,255,255,0.7);
  border: 1px solid #cbd5e1;
  border-radius: 2px;
  padding: 1px 6px;
}
.avm-section-bar svg {
  flex-shrink: 0;
  stroke: currentColor;
  width: 11px;
  height: 11px;
  max-width: 11px;
  max-height: 11px;
}

/* BOM area */
.avm-bom-area {
  background: #fff;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: none;
  overflow: hidden;
}
.avm-bom-area--iso {
  border: 1.5px solid #0f172a;
  border-radius: 0;
  box-shadow: none;
  gap: 0;
  padding: 0;
  overflow: hidden;
}
.avm-bom-title {
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #0f172a;
  padding: 8px 10px;
  border-bottom: 1.5px solid #0f172a;
  background: #f8fafc;
}
.avm-bom-section {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-bottom: 1px solid #e2e8f0;
}
.avm-bom-section:last-child { border-bottom: none; }
.avm-bom-section--iso {
  margin: 0;
  border: none;
  border-bottom: 1px solid #0f172a;
  background: #fff;
}
.avm-bom-section--iso:last-of-type { border-bottom: none; }
.avm-bom-section--iso .avm-section-bar {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid #0f172a;
  padding: 5px 10px;
  font-size: 10px;
}
.avm-bom-area--iso > #asmViewEmpty {
  margin: 8px 12px 12px;
}

/* ISO title block (ISO 7200-inspired) */
.avm-iso-titleblock {
  display: grid;
  grid-template-columns: 1.1fr 1.6fr auto;
  gap: 8px;
  align-items: end;
  padding: 8px 12px 6px;
  border-bottom: 2px solid #0f172a;
  background: #fff;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.avm-iso-tb-logo {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #0f172a;
}
.avm-iso-tb-doc {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  margin-top: 2px;
}
.avm-iso-tb-h1 {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.avm-iso-tb-sub {
  margin-top: 1px;
  font-size: 10px;
  font-weight: 600;
  color: #475569;
}
.avm-iso-tb-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.avm-iso-tb-meta span,
.avm-iso-info-item span,
.avm-iso-field span {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}
.avm-iso-tb-meta b,
.avm-iso-info-item b {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  margin-top: 1px;
}
.avm-iso-infobar {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid #0f172a;
  background: #f8fafc;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.avm-iso-info-item {
  flex: 1 1 0;
  min-width: 100px;
  padding: 5px 10px;
  border-right: 1px solid #cbd5e1;
}
.avm-iso-info-item:last-child { border-right: none; }

/* ISO material tables — full-width columns, no sketch borders */
.avm-iso-table-wrap {
  width: 100%;
  overflow-x: auto;
  background: #fff;
}
.avm-iso-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
  color: #000;
}
.avm-iso-table thead th {
  padding: 3px 5px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: #000;
  background: #e8e8e8;
  border: 1px solid #000;
  border-bottom: 1.5px solid #000;
  text-align: left;
  white-space: normal;
  vertical-align: middle;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.avm-iso-table thead th.c,
.avm-iso-table td.c { text-align: center; }
.avm-iso-table thead th.r,
.avm-iso-table td.r { text-align: right; }
.avm-iso-table tbody td {
  padding: 2px 4px;
  border: 1px solid #b0b0b0;
  vertical-align: middle;
  font-size: 9.5px;
  line-height: 1.2;
  color: #000;
  background: #fff;
}
.avm-iso-table tbody tr:nth-child(even) td {
  background: #f7f7f7;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.avm-iso-table tbody tr:last-child td { border-bottom: 1px solid #b0b0b0; }
.avm-iso-table tbody tr.avm-iso-line--marked td,
.avm-iso-table tbody tr[data-asm-row-key].avm-iso-line--marked td {
  background: #eaf3ff !important;
}
.avm-iso-table tbody tr.avm-iso-line--marked {
  box-shadow: inset 3px 0 0 #1d4ed8;
}
.avm-iso-table td.sketch {
  padding: 3px 5px;
  width: 76px;
}
.avm-iso-table td.sketch .avm-thumb,
.avm-iso-table td.sketch .avm-thumb-placeholder,
.avm-iso-table td.sketch .sfx-profile-thumb {
  width: 64px !important;
  height: 52px !important;
  max-width: 64px !important;
  max-height: 52px !important;
  margin: 0 auto;
  border: none !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
  display: block;
  object-fit: contain;
  visibility: visible !important;
  opacity: 1;
}
.avm-iso-table td.sketch .sfx-profile-thumb--empty {
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  background: #f8fafc !important;
  border: 1px dashed #cbd5e1 !important;
}
.avm-iso-table td.code {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  color: #000;
  font-size: 10px;
  white-space: nowrap;
  word-break: normal;
  width: 18%;
  min-width: 108px;
}
.avm-iso-unitline {
  display: none !important;
}
.avm-iso-table td.desc {
  font-weight: 400;
  color: #000;
  word-break: break-word;
  width: 28%;
}
.avm-iso-table td.cut,
.avm-iso-table td.cutlen,
.avm-iso-table td.degree {
  white-space: nowrap;
  color: #000;
}
.avm-iso-table td.cutlen {
  font-weight: 600;
}
.avm-iso-cutlen {
  display: none;
}
.avm-iso-table td.total { font-weight: 700; color: #000; }
.avm-iso-table td.color {
  font-weight: 400;
  color: #000;
  white-space: nowrap;
}
.avm-iso-table td.remarks {
  font-weight: 400;
  font-size: 9px;
  letter-spacing: 0;
  text-transform: none;
  color: #000;
  white-space: nowrap;
}
.avm-iso-table .mono,
.avm-iso-table td.mono {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
  color: #000;
}
.avm-iso-dim {
  color: #000;
  font-weight: 700;
  margin-left: 4px;
  white-space: nowrap;
}
.avm-iso-empty {
  padding: 14px 8px !important;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
  font-style: italic;
  background: #fafafa !important;
}
.avm-iso-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 12px 10px;
  padding-top: 8px;
  border-top: 1.5px solid #0f172a;
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
}

.avm-table-wrap {
  overflow-x: auto;
  border: none;
  border-top: none;
  border-radius: 0;
  background: #ffffff;
}

/* Table */
.avm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.avm-table thead tr {
  background: #e8eef4;
}
.avm-table thead th {
  padding: 6px 8px;
  font-family: var(--font-heading);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0f172a;
  border-bottom: 1px solid #94a3b8;
  white-space: nowrap;
  text-align: left;
}
.avm-table--striped tbody tr:nth-child(even) { background: #f8fafc; }
.avm-table tbody tr:hover { background: #f1f5f9 !important; }
.avm-table tbody td {
  padding: 5px 8px;
  color: #0f172a;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
  line-height: 1.3;
}
.avm-table tbody tr:last-child td { border-bottom: none; }
.avm-th-center { text-align: center !important; }
.avm-th-right  { text-align: right !important; }
.avm-td-center { text-align: center; }
.avm-td-right  { text-align: right; font-variant-numeric: tabular-nums; }
.avm-td-mono   { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10.5px; }
.avm-td-code   { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10.5px; font-weight: 700; color: #0f172a; }
.avm-td-unit   { font-weight: 700; color: #0f172a; font-size: 11px; }
.avm-td-total  { font-weight: 700; color: #0f172a; }

.avm-color-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 1px 6px;
  border-radius: 0;
  border: 1px solid #94a3b8;
  background: #f8fafc;
  color: #0f172a;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.avm-color-chip--empty {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #94a3b8;
}

/* Profile image thumbnail cell */
.avm-thumb-cell { text-align: center; padding: 3px 5px !important; width: 76px; }
.avm-thumb {
  width: 64px;
  height: 52px;
  object-fit: contain;
  border-radius: 0;
  border: none;
  background: transparent;
  display: block;
  margin: 0 auto;
}
.avm-thumb-placeholder {
  width: 64px;
  height: 52px;
  border-radius: 0;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  color: #cbd5e1;
  font-size: 16px;
}

/* Glass row */
.avm-glass-row-inner { overflow-y: auto; flex: 1; }

/* ── New Assembly & Profile Data UI ────────────────────────── */

/* Sub-section heading inside group editors */
.az-sub-head .az-btn-import-group {
  margin-left: auto;
  background: #1e40af;
  color: #fff;
  border-color: #1e40af;
  font-size: 11px;
  padding: 3px 10px;
  white-space: nowrap;
}
.az-cell-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ══ Assembly list page ══════════════════════════════════════ */
.az-asm-list {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.az-asm-list-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 18px 12px;
}
.az-asm-list-hero-text { min-width: 220px; flex: 1 1 280px; }
.az-asm-list-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #0f172a;
  line-height: 1.25;
}
.az-asm-list-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
  max-width: 560px;
}
.az-asm-list-hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.az-asm-list-marked {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  padding: 0 4px;
  min-width: 72px;
  text-align: right;
}
.az-asm-list-sep {
  width: 1px;
  height: 22px;
  background: #e2e8f0;
  margin: 0 4px;
}
.az-asm-list-card {
  margin: 0 18px 18px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}
.az-asm-list-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.az-asm-list-filters .az-input {
  font-size: 12px;
  padding: 6px 9px;
  min-height: 32px;
  width: auto;
  min-width: 132px;
  background: #fff;
}
.az-asm-list-search { flex: 1 1 200px; max-width: 280px; min-width: 180px !important; }
.az-asm-list-filter-spacer { flex: 1 1 12px; }
.az-asm-list-count {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.az-asm-list-filters .az-btn {
  font-size: 11px;
  padding: 5px 10px;
  height: 32px;
}
@media (max-width: 980px) {
  .az-asm-list-hero { flex-direction: column; align-items: stretch; padding-bottom: 10px; }
  .az-asm-list-hero-actions { justify-content: flex-start; }
  .az-asm-list-search { max-width: none; flex: 1 1 100%; }
  .az-asm-list-sep { display: none; }
}
.az-asm-list-table-wrap {
  padding: 0;
  overflow: auto;
  max-height: min(70vh, 720px);
}
.az-asm-list-table-wrap .az-empty-row {
  padding: 36px 16px !important;
  color: #64748b;
  font-size: 13px;
}

/* ══ Assembly Configurations — ISO PBS aligned table ═════════ */
#azAsmCmpTable.az-asm-tree-table,
#azCwAsmCmpTable.az-asm-tree-table {
  table-layout: fixed;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: none;
  border-radius: 0;
  overflow: visible;
  background: #fff;
}
#azAsmCmpTable.az-asm-tree-table thead th,
#azCwAsmCmpTable.az-asm-tree-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f1f5f9;
  color: #475569;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 9px 12px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
#azAsmCmpTable.az-asm-tree-table .az-asm-tree-col-toggle,
#azCwAsmCmpTable.az-asm-tree-table .az-asm-tree-col-toggle { width: 44px; text-align: center; padding-left: 10px; padding-right: 4px; }
#azAsmCmpTable.az-asm-tree-table .az-asm-tree-col-name,
#azCwAsmCmpTable.az-asm-tree-table .az-asm-tree-col-name { width: auto; }
#azAsmCmpTable.az-asm-tree-table .az-asm-tree-col-level,
#azCwAsmCmpTable.az-asm-tree-table .az-asm-tree-col-level { width: 132px; }
#azAsmCmpTable.az-asm-tree-table .az-asm-tree-col-status,
#azCwAsmCmpTable.az-asm-tree-table .az-asm-tree-col-status { width: 140px; }
#azAsmCmpTable.az-asm-tree-table .az-asm-tree-col-actions,
#azCwAsmCmpTable.az-asm-tree-table .az-asm-tree-col-actions { width: 118px; text-align: right; padding-right: 14px; }

.az-asm-tree-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.az-asm-tree-select-all input {
  margin: 0;
  accent-color: #1d4ed8;
}

#azAsmCmpTable.az-asm-tree-table .az-asm-tree-row td,
#azCwAsmCmpTable.az-asm-tree-table .az-asm-tree-row td {
  padding: 7px 12px;
  border-bottom: 1px solid #eef2f7;
  vertical-align: middle;
  font-size: 12.5px;
  color: #0f172a;
  height: 42px;
  box-sizing: border-box;
}
#azAsmCmpTable.az-asm-tree-table .az-asm-tree-row:last-child td,
#azCwAsmCmpTable.az-asm-tree-table .az-asm-tree-row:last-child td {
  border-bottom: none;
}

.az-asm-tree-toggle-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 22px;
}

.az-asm-tree-toggle {
  appearance: none;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 0;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}
.az-asm-tree-toggle:hover {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.az-asm-tree-toggle-spacer {
  display: inline-block;
  width: 22px;
  height: 22px;
}

.az-asm-tree-name {
  --asm-depth: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-left: calc(var(--asm-depth) * 22px);
  position: relative;
}
.az-asm-tree-guides { display: none; }
.az-asm-tree-check {
  margin: 0;
  flex: 0 0 auto;
  accent-color: #1d4ed8;
  width: 14px;
  height: 14px;
}
.az-asm-tree-icon {
  display: inline-flex;
  flex: 0 0 auto;
  color: #64748b;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
}
.az-asm-tree-label {
  font-weight: 600;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.az-asm-tree-label--config {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.az-asm-tree-level-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  white-space: nowrap;
}
.az-asm-tree-level-pill--brand { background: #0f172a; color: #fff; }
.az-asm-tree-level-pill--system { background: #dbeafe; color: #1d4ed8; }
.az-asm-tree-level-pill--type { background: #dcfce7; color: #15803d; }
.az-asm-tree-level-pill--config { background: #ede9fe; color: #6d28d9; }
.az-asm-tree-level-pill--doc { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }

.az-asm-tree-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  background: #e2e8f0;
  border-radius: 999px;
  white-space: nowrap;
}
.az-asm-tree-status {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.az-asm-tree-status--ok { color: #0f766e; }
.az-asm-tree-status--muted { color: #94a3b8; font-weight: 500; }
.az-asm-tree-status--off { color: #b45309; font-weight: 700; }

.az-asm-tree-row--config.is-disabled {
  opacity: 0.62;
  background: #fffbeb;
}
.az-asm-off-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
}
.az-asm-toggle-btn {
  appearance: none;
  border: 1px solid #fbbf24;
  background: #fffbeb;
  color: #92400e;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.az-asm-toggle-btn.is-off {
  border-color: #86efac;
  background: #ecfdf5;
  color: #047857;
}
.az-asm-enabled-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}

.az-asm-tree-actions {
  display: inline-flex;
  gap: 2px;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  padding: 2px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #fff;
}
.az-asm-tree-open,
.az-asm-tree-open-btn {
  appearance: none;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.az-asm-tree-row--leaf:hover .az-asm-tree-open,
.az-asm-tree-open-btn:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
  text-decoration: none;
}

.az-asm-tree-row--brand td {
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
  border-top: 8px solid #f1f5f9;
}
#azAsmCmpTable.az-asm-tree-table tbody > .az-asm-tree-row--brand:first-child td,
#azCwAsmCmpTable.az-asm-tree-table tbody > .az-asm-tree-row--brand:first-child td {
  border-top: none;
}
.az-asm-tree-row--brand td:first-child { box-shadow: inset 3px 0 0 #0f172a; }
.az-asm-tree-row--brand .az-asm-tree-label {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.az-asm-tree-row--brand .az-asm-tree-icon { color: #0f172a; }
.az-asm-tree-row--system td { background: #fcfdff; }
.az-asm-tree-row--system td:first-child { box-shadow: inset 3px 0 0 #3b82f6; }
.az-asm-tree-row--system .az-asm-tree-icon { color: #2563eb; }
.az-asm-tree-row--type td { background: #fff; }
.az-asm-tree-row--type td:first-child { box-shadow: inset 3px 0 0 #22c55e; }
.az-asm-tree-row--type .az-asm-tree-icon { color: #15803d; }
.az-asm-tree-row--config td { background: #fff; }
.az-asm-tree-row--config td:first-child { box-shadow: inset 3px 0 0 #8b5cf6; }
.az-asm-tree-row--config.is-marked td { background: #eff6ff; }
.az-asm-tree-row--config:hover td,
.az-asm-tree-row--brand:hover td,
.az-asm-tree-row--system:hover td,
.az-asm-tree-row--type:hover td { background: #f1f5f9; }
.az-asm-tree-row--config.is-marked:hover td { background: #dbeafe; }
.az-asm-tree-row--leaf { cursor: pointer; }
.az-asm-tree-row--leaf td {
  height: 36px;
  background: #fafbfc;
}
.az-asm-tree-row--leaf td:first-child { box-shadow: inset 3px 0 0 #cbd5e1; }
.az-asm-tree-row--leaf:hover td { background: #eff6ff; }
.az-asm-tree-row--leaf .az-asm-tree-label { font-weight: 500; color: #475569; }
.az-asm-tree-row--assembly .az-asm-tree-icon { color: #1d4ed8; }
.az-asm-tree-row--elevation .az-asm-tree-icon { color: #0f766e; }
.az-asm-tree-row--details .az-asm-tree-icon { color: #b45309; }
.az-asm-tree-row--brand,
.az-asm-tree-row--system,
.az-asm-tree-row--type { cursor: pointer; }

/* ══ Assembly Compose — modern editor layout ══════════════════ */
.az-cmp-subtabs {
  display: flex;
  gap: 2px;
  padding: 10px 18px 0;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}
.az-cmp-subtab {
  appearance: none;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  padding: 9px 14px 10px;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #64748b;
  cursor: pointer;
  border-radius: 0;
  transition: color .15s ease, border-color .15s ease;
  margin-bottom: -1px;
}
.az-cmp-subtab:hover { color: #1e40af; background: transparent; }
.az-cmp-subtab.active {
  color: #1e3a8a;
  background: transparent;
  border-color: transparent;
  border-bottom-color: #1d4ed8;
}

.az-cmp-editor-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  position: sticky;
  top: 0;
  z-index: 5;
}
.az-cmp-editor-titles { display: flex; flex-direction: column; gap: 1px; }
.az-cmp-editor-titles > span:first-child {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  color: #0f172a;
}
.az-cmp-editor-sub { font-size: 11px; color: #94a3b8; }

.az-cmp-editor-body {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.az-cmp-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  box-sizing: border-box;
}
.az-cmp-card-head {
  --cmp-accent: #2563eb;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--cmp-accent);
  padding-bottom: 9px;
  margin-bottom: 12px;
  border-bottom: 1px solid #eef2f7;
}
.az-cmp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cmp-accent);
  flex: 0 0 auto;
}
.az-cmp-card-head .az-btn-sm { margin-left: auto; }
.az-cmp-head-hint {
  font-weight: 400;
  font-size: 10.5px;
  letter-spacing: 0;
  text-transform: none;
  color: #94a3b8;
}
.az-cmp-groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 14px;
}
.az-cmp-groups-grid > .az-cmp-card { min-width: 0; }

.az-cmp-rows { display: flex; flex-direction: column; gap: 10px; }

.az-cmp-elev-note {
  padding: 8px 11px;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  background: #f0fdfa;
  font-size: 11px;
  color: #0f766e;
  line-height: 1.45;
}
.az-cmp-elev-body {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(280px, 1.15fr);
  gap: 14px;
  align-items: stretch;
  margin-top: 10px;
}
@media (max-width: 920px) {
  .az-cmp-elev-body { grid-template-columns: 1fr; }
}
.az-cmp-elev-fields { min-width: 0; }
.az-cmp-elev-preview {
  border: 1px solid #99f6e4;
  border-radius: 10px;
  background: #f8fffe;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.az-cmp-elev-preview-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid #ccfbf1;
  background: #f0fdfa;
}
.az-cmp-elev-preview-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0f766e;
}
.az-cmp-elev-preview-meta {
  font-size: 10.5px;
  color: #0f766e;
  font-family: var(--font-mono, ui-monospace, monospace);
  text-align: right;
}
.az-cmp-elev-preview-stage {
  position: relative;
  flex: 1;
  min-height: 240px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
}
.az-cmp-elev-preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.45;
}
.az-cmp-elev-preview-stage.has-svg .az-cmp-elev-preview-empty { display: none; }
#azCmpElevPreviewSvg {
  width: 100%;
  height: 260px;
  display: none;
}
.az-cmp-elev-preview-stage.has-svg #azCmpElevPreviewSvg { display: block; }
.az-cmp-elev-preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 0;
  padding: 0 12px 10px;
}
.az-cmp-elev-preview-chips:empty { display: none; }
.az-cmp-elev-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ccfbf1;
  color: #115e59;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.az-cmp-actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  margin: 4px -4px -8px;
  background: linear-gradient(180deg, rgba(255,255,255,0), #ffffff 32%);
  border-top: 1px solid #eef2f7;
  border-radius: 0 0 12px 12px;
}
.az-cmp-actions .az-btn--save { padding: 8px 22px; font-size: 12.5px; }

.az-cmp-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cmp-accent, #2563eb);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  flex: 0 0 auto;
}
.az-cmp-identity-grid {
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(160px, 1fr));
  padding: 0;
}
.az-cmp-panel-summary,
.az-cmp-restrict-summary {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  color: #475569;
  line-height: 1.55;
  min-height: 42px;
}
.az-cmp-restrict-summary:empty { display: none; }
.az-cmp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.az-cmp-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e2e8f0;
  font-size: 11px;
  color: #334155;
}
.az-cmp-chip b { font-weight: 700; color: #0f172a; }

.az-cmp-modal {
  position: fixed;
  inset: 0;
  z-index: 9600;
  background: rgba(15, 23, 42, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.az-cmp-modal-dialog {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  max-height: 92vh;
  width: min(1100px, 96vw);
  overflow: hidden;
}
.az-cmp-modal-dialog--xl { width: min(1180px, 96vw); min-height: 70vh; }
.az-cmp-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.az-cmp-modal-title { font-size: 16px; font-weight: 800; color: #0f172a; }
.az-cmp-modal-sub { font-size: 12px; color: #64748b; margin-top: 3px; }
.az-cmp-modal-close {
  width: 36px;
  height: 36px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.az-cmp-modal-close:hover { background: #f1f5f9; }
.az-cmp-modal-body {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.2fr);
  gap: 0;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}
.az-cmp-panel-cards {
  overflow: auto;
  padding: 14px;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f8fafc;
}
.az-cmp-panel-card {
  text-align: left;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  width: 100%;
}
.az-cmp-panel-card:hover { border-color: #93c5fd; }
.az-cmp-panel-card.is-on {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}
.az-cmp-panel-card b { display: block; font-size: 13px; color: #0f172a; margin-bottom: 4px; }
.az-cmp-panel-card span { font-size: 11px; color: #64748b; }
.az-cmp-panel-preview {
  overflow: auto;
  padding: 18px 20px;
  font-size: 13px;
  color: #334155;
  line-height: 1.55;
}
.az-cmp-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}
@media (max-width: 900px) {
  .az-cmp-groups-grid { grid-template-columns: 1fr; }
  .az-cmp-identity-grid { grid-template-columns: 1fr 1fr; }
  .az-cmp-modal-body { grid-template-columns: 1fr; }
  .az-cmp-panel-cards { border-right: 0; border-bottom: 1px solid #e2e8f0; max-height: 36vh; }
}

/* ── Create Unit: Assembly models picker ── */
.cu-asm-model-carousel {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.cu-asm-model-nav {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cu-asm-model-nav:hover { background: #f1f5f9; border-color: #94a3b8; }
.cu-asm-model-track,
.cu-elev-pick-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 4px 2px 8px;
  flex: 1;
  min-width: 0;
}
.cu-asm-model-track::-webkit-scrollbar,
.cu-elev-pick-grid::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.cu-asm-model-track::-webkit-scrollbar-thumb,
.cu-elev-pick-grid::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.cu-elev-pick-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: #fff;
  border: 1.5px solid #dbe3ee;
  border-radius: 10px;
  cursor: pointer;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  flex: 0 0 168px;
  width: 168px;
  font-family: inherit;
  color: inherit;
  text-align: left;
}
.cu-elev-pick-card:hover,
.cu-elev-pick-card:focus-visible { border-color: #93c5fd; box-shadow: 0 4px 10px rgba(37,99,235,.10); }
.cu-elev-pick-card.selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.14);
}
.cu-elev-pick-thumb {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 6px;
}
.cu-elev-pick-thumb--3d {
  background: linear-gradient(165deg, #f8fafc 0%, #e2e8f0 100%);
}
.cu-elev-pick-3d-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}
.cu-elev-pick-loading {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}
.cu-elev-pick-thumb svg { max-width: 100%; max-height: 100%; width: auto; height: auto; }
.cu-elev-pick-noelev {
  font-size: 10.5px;
  color: #94a3b8;
  text-align: center;
  line-height: 1.5;
  padding: 8px;
}
.cu-elev-pick-name { font-size: 11.5px; font-weight: 700; color: #0f172a; line-height: 1.3; }
.cu-elev-pick-sub  { font-size: 10px; color: #64748b; }
.cuw-elev-popup-body .cu-elev-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  overflow: visible;
  flex-wrap: wrap;
}
.cuw-elev-popup-body .cu-elev-pick-card {
  flex: none;
  width: auto;
}

/* Small add-row button */
.az-btn-sm {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.az-btn-sm:hover { background: var(--accent-hover); }

/* Row actions bar (save/discard inline rows) */
.az-row-actions {
  display: flex;
  gap: 8px;
  padding: 5px 0 2px;
  justify-content: flex-end;
}

/* Editable inline table inputs */
.az-tbl-input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  font-size: 12px;
  font-family: var(--font-ui);
  color: var(--text-primary);
  padding: 2px 4px;
  border-radius: 3px;
  transition: border-color 0.1s, background 0.1s;
}
.az-tbl-input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}
.az-tbl-input.az-mono { font-family: var(--font-mono); }
.az-tbl-select {
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 12px;
  font-family: var(--font-ui);
  color: var(--text-primary);
  padding: 2px 4px;
  border-radius: 3px;
}
.az-tbl-select:focus { outline: none; border-color: var(--accent); }
.fc-art-choice { display: flex; flex-direction: column; gap: 4px; min-width: 148px; }
.fc-art-choice [hidden] { display: none !important; }

/* Compact inline inputs in main frames table */
.az-asm-main-frames-tbl td input,
.az-asm-main-sash-tbl td input,
.az-asm-main-frames-tbl td select,
.az-asm-main-sash-tbl td select {
  width: 100%;
  min-width: 60px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 11.5px;
  font-family: var(--font-ui);
  padding: 3px 5px;
  border-radius: 3px;
}
.az-asm-main-frames-tbl td input:read-only,
.az-asm-main-sash-tbl td input:read-only {
  background: var(--grid-stripe, #f7f9fb);
  color: var(--text-muted);
}
.az-asm-main-frames-tbl td input:focus,
.az-asm-main-sash-tbl td input:focus,
.az-asm-main-frames-tbl td select:focus,
.az-asm-main-sash-tbl td select:focus { outline: none; border-color: var(--accent); }

/* Position bold cells */
.az-asm-main-frames-tbl td:first-child,
.az-asm-main-sash-tbl td:first-child {
  font-weight: 700;
  font-size: 12px;
  color: var(--text-primary);
  background: var(--bg-panel-hdr);
  white-space: nowrap;
}

/* Elevation units table row inputs */
.az-elev-row td input,
.az-elev-row td select {
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 12px;
  font-family: var(--font-ui);
  padding: 3px 5px;
  border-radius: 3px;
}
.az-elev-row td input:focus,
.az-elev-row td select:focus { outline: none; border-color: var(--accent); }

/* Interlock section inside sash editor */
#azAsmSashInterlockSection {
  transition: all 0.2s ease;
}

/* Main frames / sash - compact table wrapper */
.az-asm-main-frames-tbl,
.az-asm-main-sash-tbl {
  min-width: 860px;
}

/* Profile data tab table - item code cell */
#azProfTable td:first-child {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-text);
}

/* Assembly group list panel table */
#azAsmGroupListTable td { font-size: 11.5px; }
#azAsmGroupListTable td:first-child { font-family: var(--font-mono); font-weight: 700; }


/* ── Assembly Compose Tab ─────────────────────────────────── */
.az-group-info-badge {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 6px 10px;
  font-size: 11.5px;
  color: var(--text-muted);
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.az-glass-slot { padding: 8px 10px; background: #fafafa; border: 1px solid #e8ecf0; border-radius: 6px; }
.az-slot-label {
  font-size: 11px; font-weight: 700; color: #7c3aed;
  background: #ede9fe; padding: 3px 8px; border-radius: 4px;
  min-width: 52px; text-align: center; flex-shrink: 0;
}

/* SmartFabX Sliding Configurator - Screenshot Style */

body {
  background: #eef1f5;
  font-family: "Segoe UI", Arial, sans-serif;
  color: #111;
}

.app-window,
.sliding-configurator,
.configurator-page {
  background: #eef1f5;
  border-radius: 18px;
  padding: 10px;
}

/* Top bar */
.titlebar,
.top-bar {
  background: linear-gradient(#f8f9fb, #e6e9ee);
  border-bottom: 1px solid #c8ccd3;
  height: 58px;
  padding: 0 16px;
  color: #111;
  box-shadow: inset 0 1px 0 #fff;
}

.app-name,
.page-title {
  font-size: 20px;
  font-weight: 700;
  color: #111;
}

/* Main layout */
.workspace,
.config-grid {
  display: grid;
  grid-template-columns: 260px 1fr 350px;
  gap: 8px;
  padding: 8px;
  background: #eef1f5;
}

/* Panels */
.panel,
.card,
.section-box,
.system-master,
.panel-layout,
.interlock-selection,
.assembly-preview {
  background: linear-gradient(#f9fafc, #e9edf2);
  border: 1px solid #c8ccd3;
  border-radius: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.9),
    0 1px 3px rgba(0,0,0,0.12);
  padding: 14px;
}

.panel h3,
.card h3,
.section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
  color: #111;
}

/* Inputs */
select,
input,
.form-control {
  height: 36px;
  border-radius: 8px;
  border: 1px solid #c4c8cf;
  background: linear-gradient(#ffffff, #e9ecf0);
  padding: 6px 10px;
  font-size: 15px;
  color: #111;
  box-shadow: inset 0 1px 0 #fff;
}

label {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

/* Buttons */
button,
.btn {
  border-radius: 8px;
  border: 1px solid #b8bdc5;
  background: linear-gradient(#ffffff, #dfe3e8);
  color: #111;
  padding: 8px 16px;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 #fff,
    0 1px 2px rgba(0,0,0,0.15);
}

button.primary,
.btn-primary,
.save-btn,
.load-btn {
  background: linear-gradient(#0b86df, #0067b8);
  color: #fff;
  border-color: #005a9e;
}

/* Tables */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 15px;
}

th {
  background: linear-gradient(#f6f7f9, #e2e5ea);
  border-bottom: 1px solid #c8ccd3;
  padding: 8px;
  text-align: left;
  font-weight: 700;
}

td {
  padding: 8px;
  border-bottom: 1px solid #d7dbe1;
  background: rgba(255,255,255,0.35);
}

/* Status badge */
.status-valid,
.badge-valid {
  background: linear-gradient(#ffffff, #e5e8ed);
  border: 1px solid #c5c9d0;
  border-radius: 7px;
  padding: 6px 14px;
  font-weight: 600;
}

.valid-green {
  color: #098b2f;
  font-weight: 800;
}

/* Assembly preview bottom */
.assembly-preview {
  grid-column: 2 / 4;
  min-height: 220px;
}

/* Small scrollbar style */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-thumb {
  background: #b8bdc5;
  border-radius: 8px;
}

::-webkit-scrollbar-track {
  background: #edf0f4;
}

