/*
 * Nam Sung V3 - shared Add/Edit underline, aligned to the table CELL rather
 * than the differently sized inputs (24px, 28px, 29px).
 * The visible mark sits at the same bottom inset of every 30px data row.
 * Never targets search/filter inputs, view rows or the orange cell-copy outline.
 */
:root { --ns-edit-focus-underline: #0d6efd; }

/* Reset the earlier focus shadow inside inline editors. The 1px underline
 * will be painted on the containing cell instead of on the input box. */
body.app-body .items-table tbody tr.editing-row :is(input, select, textarea):focus,
body.app-body.nvlp-page #itemsTable tbody tr.nvlp-editing input:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* Every editable table cell is the coordinate frame for the underline. */
body.app-body .items-table tbody tr.editing-row td:has(:is(input, select, textarea):focus),
body.app-body.nvlp-page #itemsTable tbody tr.nvlp-editing td:has(input:focus) {
  position: relative;
}

/* Keep the first Auxiliary Materials column sticky during horizontal scroll. */
body.app-body.nvlp-page #itemsTable tbody tr.nvlp-editing td:first-child:has(input:focus) {
  position: sticky;
}

/* 1px straight blue line, always 1px above the cell's bottom border. */
body.app-body .items-table tbody tr.editing-row td:has(:is(input, select, textarea):focus)::after,
body.app-body.nvlp-page #itemsTable tbody tr.nvlp-editing td:has(input:focus)::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 1px;
  height: 1px;
  background: var(--ns-edit-focus-underline);
  pointer-events: none;
  z-index: 2;
}

/* Narrow Auxiliary Materials columns have 5px horizontal cell padding. */
body.app-body.nvlp-page #itemsTable tbody tr.nvlp-editing td:has(input:focus)::after {
  left: 5px;
  right: 5px;
}

/* Neutralize the old orange input BORDER without changing its box model.
 * The orange outline of a copied TABLE CELL is a separate feature. */
body.app-body.nvlp-page #itemsTable tbody tr.nvlp-editing input:focus {
  border-color: transparent !important;
}

/* Admin form fields do not live in table cells. Keep their existing 30px
 * control dimensions and show the same 1px blue bottom border on focus. */
body.app-body.admin-page #editorForm .admin-fields input:not([type="checkbox"]):focus,
body.app-body.admin-page #editorForm .admin-fields select:focus,
body.app-body.admin-page .admin-modal-form input:not([type="checkbox"]):focus {
  outline: none !important;
  border-color: #ced4da !important;
  border-bottom-color: var(--ns-edit-focus-underline) !important;
  box-shadow: none !important;
}
