/* --- Container --- */
#boqContainer {
  background-color: #111;
  color: #ddd;
  font-family: "Inter", sans-serif;
  padding: 1rem;
  border-radius: 8px;
}

#storyBOQ {
  /* padding: 20px; */
}

/* --- Project header --- */
.boq-project-header {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
  border-bottom: 1px solid #333;
  padding-bottom: 0.4rem;
  background-color: #1d1d1d;
  padding: 5px 5px 5px 9px;
}

/* --- Scene header --- */
.boq-scene-header {
  white-space: nowrap;
  text-overflow: ellipsis;
  width: 1364px;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #aaa;
  background: #1d1d1d;
  padding: 6px 8px;
  display: grid;
  grid-column-gap: 5px;
  align-items: end;
  grid-template-columns:231px
0px
0px
71px
54px
49px
18px
40px
55px
449px
65px
108px
116px
65px;
}

.column_label.scene-total {
  font-weight: 800 !important;
  font-size: 14px !important;
  font-style: normal !important;
}

.boq-scene-btn-add {
  position: absolute;
  width: 23px;
  height: 22px;
  background-color: #606060;
  padding: 0px;
  border-radius: 5px;
  padding-left: 7px;
  border: 0px;
  box-sizing: border-box;
  align-items: center;
  justify-items: center;
  color: #0a0a0a;
  opacity: 1;
  font-size: 12px;
  cursor: pointer;
  line-height: 1;
  align-content: center;
  /* right: 30px; */
  left: 1350px;
  display: block;
  font-weight: 900;
}
.boq-scene-btn-add:hover {
  opacity: 1;
  background: #623c6f; color: #fff;
}

/* .boq-cell-editing {
  background: #1f1f1f;
  outline: 1px solid #4a90e2;
}

.boq-cell-input {
  width: 100%;
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  padding: 2px 4px;
}

.boq-cell-input:focus {
  outline: none;
} */
/* --- Row containers --- */
.boq-scene-rows {
  position: relative;
  left: 30px;
}
.boq-row {
  display: flex;
  flex-direction: column;
  gap: 4px; /* space between main row and children */
  margin-bottom: 6px; /* vertical spacing between sibling rows */
  position: relative;
  left: 0px;
}

.row-main {
  position: relative;
  height: 28px;
  width: 1350px;
  display: grid;
  grid-column-gap: 5px;
  grid-template-columns:210px
50px
55px
35px
55px
33px
57px
533px
69px
99px
75px
20px;
  box-sizing: border-box;
  transition: background 0.2s;
  overflow: hidden;
  align-items: center;
  justify-items: start;
  padding: 2px;
}

.row-main > .col {
  padding-left: 8px;
  /* padding-right: 20px; */
}

.row-main > * {
  /* border-right: 1px solid #222; */
}

.row-main > *:last-child {
  border-right: none; /* optional, avoid double border on last column */
}

/* --- Indentation background --- */
.row-main::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: calc(var(--indent-level, 0) * 10px);
  background-color: #2d2d2d;
  border-right: 1px solid #222;
  z-index: 0;
}

/* --- Hover states --- */
.row-main:hover {
  background-color: #1b1b1b;
}

/* --- Columns --- */
.col {
  /* overflow: hidden; */
  white-space: nowrap;
  text-overflow: ellipsis;
  z-index: 1; /* ensure above pseudo element */
  font-size: 13px;
  /* width: 250px; */
  display: inline-block;
}

.col.itemName {
  position: relative;
  left:calc(var(--indent-level, 0) * 10px);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  width: 250px;
}
.col.quantity {
  text-align: right;
  padding-right: 5px;
}
.col.itemID {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
}
.col.width {
  font-size: 11px;
  font-weight: 100;
  text-align: right;
  width: 50px;
}
.col.height {
  font-size: 11px;
  font-weight: 100;
  text-align: right;
  width: 50px;
}
.col.groupID {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
}
.col.itemDescription {
  display: flex;
  /* align-items: center; */
  gap: 6px;
  font-size: 11px;
  font-weight: 300;
}
.col.label {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  display: flex;
  padding-left: 10px;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  width: 300px;
  max-width: 300px;
  display: inline-block;

}
.col.unit {
  font-size: 11px;
  font-weight: 100;
  width: 30px;
}
.col.user {
  font-size: 11px;
  font-weight: 500;
  width: 30px;
  background-color: #2b2929;
  color: #454443;
  border-radius: 3px;
  border: 0px;
  width: 60px;
  height: 16px;
  min-width: 30px;
  max-width: 60px;
  padding: 2px;
  /* padding-left: 6px; */
  align-items: center;
  text-align: center;
  justify-items: center;
  box-sizing: border-box;
  padding-bottom: 16px;
}
.col.quantity {
  font-size: 11px;
  font-weight: 100;
  text-align: right;
  width: 50px;
}
.col.unitPrice {
  font-size: 11px;
  font-weight: 100;
  text-align: right;

  width: 50px;
}
.col.total {
  font-size: 13px;
  font-weight: 500;
  text-align: right;
  padding-right: 5px;
}
.col.notes {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 300;
  width: 500px;
  max-width: 500px;
  display: inline-block;

}

td, .col {
  min-width: 50px;   /* or some reasonable value */
  min-height: 20px;  /* ensures empty cells are still clickable */
}

.col.itemName input[type="text"] {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  width: 235px
}
.col.width input[type="number"] {
  display: flex;
  align-items: center;
  text-align: right;
  gap: 6px;
  font-size: 11px;
  font-weight: 100;
  width: 60px;
}
.col.height input[type="number"] {
  display: flex;
  align-items: center;
  text-align: right;
  gap: 6px;
  font-size: 11px;
  font-weight: 100;
  width: 60px;
}
.col.quantity input[type="number"] {
  display: flex;
  align-items: center;
  text-align: right;
  gap: 6px;
  font-size: 11px;
  font-weight: 100;
  width: 40px;
}
.col.notes input[type="text"] {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 100;
  width: 500px;
}
.col.unit_price input[type="number"] {
  display: flex;
  align-items: center;
  text-align: right;
  gap: 6px;
  font-size: 11px;
  font-weight: 100;
  width: 75px;
}
.col.unit input[type="text"] {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 6px;
  font-size: 11px;
  font-weight: 100;
  width: 35px;
}
.col.itemDescription input[type="text"] {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 300;
  width: 500px;
}



.col.ctrlButton {
  width: 23px;
  height: 18px;
  min-width: 23px;
  max-width: 23px;
  background: #343434;
  padding: 2px;
  padding-bottom: 20px;
  border-radius: 3px;
  border: 0px;
  box-sizing: border-box;
  align-items: center;
  justify-items: start;
  font-weight: 900;
}
.col.ctrlButton:hover {
   background: #623c6f; color: #fff;
}

.col.controls {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.indentButton {
  background: rgba(42, 49, 52, 0) !important;
  color: #4a4a4a;
}
.indentButton:hover {
   background: #623c6f !important;
   color: #fff !important;
}

.boq-row .col input {
  white-space: nowrap;
  text-overflow: ellipsis;
  width: 80%;
  /* min-width: 250px; */
  min-height: 18px;
  border: 1px solid #666;
  padding: 2px;
  padding-left: 5px;
  padding-right: 5px;
  background-color: #3e3e3e;
  color: #fff;
  pointer-events: auto;
  user-select: text;
}
.row-main {
  background: #222222;
}
/* --- Group / Item distinctions --- */
.group-row > .row-main {
  background: ##1c1c1c;
  font-weight: 600;
}

.item-row > .row-main {
  background: ##212121;
}

/* --- Child rows --- */
.children {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 4px;
  transition: all 0.15s ease;
}

.collapsed > .children {
  display: none;
}

.boq-table.collapsed {
  display: none;
}

/* --- Buttons --- */
.boq-add-btn,
.boq-del-btn {
  background: #333;
  color: #ccc;
  border: none;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}

.boq-add-btn:hover { background: #2b6; color: #fff; }
.boq-del-btn:hover { background: #a33; color: #fff; }

.group-toggle {
  background-color: #4d4a4a;
  border: 0px;
  color: #ac9191;
  border-radius: 6px;
}
.scene-toggle {
  position: relative;
  top: 5px;
  width: 19px;
  height: 18px;
  background-color: #4d4a4a;
  border: 0px;
  color: #ac9191;
  border-radius: 6px;
}
/* --- Drag handle --- */
.boq-drag-handle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 18px;
  height: 18px;
  background: none;
  border: none;
  cursor: grab;
  padding: 0;
  z-index: 2;
}

.boq-drag-handle span {
  display: block;
  width: 12px;
  height: 2px;
  background-color: #666;
  margin: 2px 0;
  border-radius: 1px;
}

.boq-drag-handle:active {
  cursor: grabbing;
}

/* --- Drag placeholder --- */
.drag-placeholder {
  height: 34px;
  border: 2px dashed #666;
  background: #1a1a1a;
  border-radius: 4px;
  margin: 3px 0;
}

/* --- Name indentation via custom property --- */
.col.name {
  padding-left: calc(var(--indent-level, 0) * 20px);
}

.column_label {
  font-family: 'Helvetica Neue', sans-serif;
  font-weight: 100 !important;
  font-style: italic !important;
  font-size: 12px !important;
  align-self: end;
}
.scene_label {
  font-family: 'Helvetica Neue', sans-serif;
  font-weight: 600 !important;
  font-style: italic !important;
  font-size: 22px !important;
  align-self: end;
  position: relative;
}

.boq-scene-rows.drop-hover {
  background: rgba(100, 150, 255, 0.08);
  outline: 2px dashed rgba(100, 150, 255, 0.5);
  outline-offset: -4px;
}

.boq-insert-line {
  height: 12px;
  margin: 8px 0;
  background: var(--accent-color, #4da3ff);
  pointer-events: none;
  position: relative;
  left: 0px;

}

.dragging {
  opacity: 0.4;
  pointer-events: auto;
}

.boq-drag-ghost {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(30, 30, 30, 0.9);
  color: white;
  border-radius: 6px;
  font-size: 12px;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.ghost-icon {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: #888;
}

.ghost-icon.frame {
  background: #4da3ff;
}

.ghost-icon.action {
  background: #ff9f43;
}
.boq-scene-table {
  min-height: 40px;
}
