/**
 * Service Request Form — Data Entry CSS
 * Add to: Admin > Structure > Webforms > Service Request > Settings > CSS/JS > CSS
 */

/* Override the size="60" HTML attribute on all inputs inside the data entry table.
   The size attribute sets a fixed character-width that ignores responsive layout. */
#data_entry_table input[type="text"],
#data_entry_table input[type="number"],
#data_entry_table input[type="date"] {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

/* Table layout: auto allows cells to size based on content/CSS rather than equal splits */
#data_entry_table table {
  width: 100% !important;
  table-layout: auto !important;
}

/* Fields cell takes all available space */
#data_entry_table td:first-child {
  width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

/* Operations cell collapses to nothing */
#data_entry_table td.webform-multiple-table--operations {
  width: 1px !important;
  min-width: 0 !important;
  max-width: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}

/* Prevent helper text from overflowing */
#data_entry_table .webform-element-description {
  white-space: normal !important;
  word-break: break-word !important;
}

/* Wrap long fieldset legend and label text */
#data_entry_table .fieldset-legend,
#data_entry_table label {
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  display: inline-block !important;
  max-width: 100% !important;
}

/* Hide "Add/Remove section" helper text */
#edit-processed-text .text-muted.small {
  display: none !important;
}

/* Add padding above "Add next box" button */
.webform-multiple-add {
  padding-top: 1rem !important;
}

/* Hide the number counter next to "Add next box" button */
.form-item-data-entry-add-more-items {
  display: none !important;
}

/* Add divider between box Box Count fieldsets */
#data_entry_table tbody tr + tr td {
  border-top: 2px solid #8B0015 !important;
  padding-top: 1rem !important;
}

/* Add divider between Storage Request fieldsets */
#service_information_table tbody tr + tr td {
  border-top: 2px solid #8B0015 !important;
  padding-top: 1rem !important;
}

/* Hide the Remove button on the first row only */
[data-drupal-selector="edit-data-entry-items-0-operations-remove"] + button {
  display: none !important;
}