/* =========================================================
   DASHBOARD TABLE
   All table-specific CSS
   Themed with goodstream_theme.css tokens
   ========================================================= */

.data-table {
  position: relative;
  overflow: visible !important;
  z-index: 0;
  width: 100%;
}

.data-table table {
  width: 95%;
  table-layout: fixed;
  margin: 0 auto;
  border-collapse: collapse;
  background: var(--gs-card-bg);
  color: var(--gs-text);
  box-shadow: var(--gs-shadow);
  border: 1px solid var(--gs-border);
  border-radius: 14px;
  overflow: hidden;
}

.data-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.68);
}

.data-table tr:hover {
  background: rgba(255, 102, 66, 0.08);
  cursor: pointer;
}

.data-table th,
.data-table td {
  text-align: left;
  border-bottom: 1px solid var(--gs-border);
  padding: 0 !important;
  margin: 0;
}

.data-table th {
  background: var(--gs-charcoal);
  color: var(--gs-text-white);
  vertical-align: middle;
  min-height: 56px;
  height: 56px;
  white-space: normal;
  word-break: break-word;
  font-weight: 800;
  font-size: 16px;
}

.data-table td {
  vertical-align: middle;
  min-height: 56px;
  height: auto !important;
}

.data-table td > * {
  padding: 0 !important;
}

.data-table td:first-child {
  line-height: 1.25;
}

/* =========================================================
   Dashboard table column widths
   Use class-based widths only.
   Do NOT use nth-child widths because the bulk-select checkbox
   column becomes the first column and breaks the layout.
   ========================================================= */

/* Bulk record selection checkbox column */
.data-table col.gs-bulk-select-col,
.data-table th.gs-bulk-select-th,
.data-table td.gs-bulk-select-td,
#dynamicTablesWrapper .data-table col.gs-bulk-select-col,
#dynamicTablesWrapper .data-table th.gs-bulk-select-th,
#dynamicTablesWrapper .data-table td.gs-bulk-select-td {
  width: 42px !important;
  min-width: 42px !important;
  max-width: 42px !important;
  padding: 0 !important;
  text-align: center !important;
  vertical-align: middle !important;
}

.data-table th.gs-bulk-select-th input,
.data-table td.gs-bulk-select-td input,
#dynamicTablesWrapper .data-table th.gs-bulk-select-th input,
#dynamicTablesWrapper .data-table td.gs-bulk-select-td input {
  width: 16px;
  height: 16px;
  margin: 0;
}

/* Contact column */
.data-table th.gs-col-contact,
.data-table td.gs-col-contact,
#dynamicTablesWrapper .data-table th.gs-col-contact,
#dynamicTablesWrapper .data-table td.gs-col-contact {
  width: 170px !important;
  min-width: 170px !important;
  max-width: 170px !important;
}

/* Address column */
.data-table th.gs-col-address,
.data-table td.gs-col-address,
#dynamicTablesWrapper .data-table th.gs-col-address,
#dynamicTablesWrapper .data-table td.gs-col-address {
  width: 260px !important;
  min-width: 260px !important;
  max-width: 260px !important;
}

/* Phase / workflow column */
.data-table th.gs-col-phase,
.data-table td.gs-col-phase,
#dynamicTablesWrapper .data-table th.gs-col-phase,
#dynamicTablesWrapper .data-table td.gs-col-phase {
  width: 260px !important;
  min-width: 260px !important;
  max-width: 260px !important;
  text-align: center;
}

/* Dropdown columns */
.data-table th.gs-col-dropdown,
.data-table td.gs-col-dropdown,
#dynamicTablesWrapper .data-table th.gs-col-dropdown,
#dynamicTablesWrapper .data-table td.gs-col-dropdown {
  width: 220px !important;
  min-width: 220px !important;
  max-width: 220px !important;
}

/* Email status */
.data-table th.gs-col-email-status,
.data-table td.gs-col-email-status,
#dynamicTablesWrapper .data-table th.gs-col-email-status,
#dynamicTablesWrapper .data-table td.gs-col-email-status {
  width: 120px !important;
  min-width: 120px !important;
  max-width: 120px !important;
  text-align: center;
}

/* Email date columns */
.data-table th.gs-col-email-date,
.data-table td.gs-col-email-date,
#dynamicTablesWrapper .data-table th.gs-col-email-date,
#dynamicTablesWrapper .data-table td.gs-col-email-date {
  width: 175px !important;
  min-width: 175px !important;
  max-width: 175px !important;
  white-space: nowrap;
}

/* Follow-up status */
.data-table th.gs-col-email-followup,
.data-table td.gs-col-email-followup,
#dynamicTablesWrapper .data-table th.gs-col-email-followup,
#dynamicTablesWrapper .data-table td.gs-col-email-followup {
  width: 130px !important;
  min-width: 130px !important;
  max-width: 130px !important;
  text-align: center;
}

/* Actions column */
.data-table th.actions-col-header,
.data-table td.row-actions-cell,
#dynamicTablesWrapper .data-table th.actions-col-header,
#dynamicTablesWrapper .data-table td.row-actions-cell {
  width: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;
  padding: 0 !important;
  text-align: center !important;
}

/* Mobile */
@media (max-width: 900px) {
  .data-table {
    width: 100%;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    padding: 0 10px 8px;
    box-sizing: border-box;
  }

  .data-table table {
    min-width: 920px;
  }

  .data-table th:nth-child(1),
  .data-table td:nth-child(1) {
    width: 220px;
  }

  .data-table th:nth-child(2),
  .data-table td:nth-child(2) {
    width: 320px;
  }

  .data-table th:nth-child(3),
  .data-table td:nth-child(3) {
    width: 240px;
  }

  .data-table th:nth-child(4),
  .data-table td:nth-child(4) {
    width: 180px;
  }

  .actions-col-header,
  .row-actions-cell {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
  }

  .row-actions-cell {
    opacity: 1;
    padding-right: 4px !important;
  }

  .row-menu-btn {
    width: 26px;
    height: 26px;
    font-size: 18px;
  }

  .row-menu-dropdown {
    right: 0;
    left: auto;
    min-width: 132px;
  }

  .table-meta-bar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
  }

  .table-meta-title {
    font-size: 15px;
  }

  .table-meta-filters {
    width: 100%;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
  }

  .gs-table-filter {
    flex: 0 0 150px;
    height: 34px;
    font-size: 13px;
  }

  .custom-dropdown-options {
    left: 0;
    transform: none;
    min-width: 150px;
  }
}

@media (max-width: 640px) {
  .data-table {
    padding: 0 8px 8px;
  }

  .data-table table {
    min-width: 720px;
  }

  .data-table th,
  .data-table td {
    font-size: 12px;
  }

  .contact-name {
    font-size: 13px;
    font-weight: 700;
  }

  .contact-info {
    font-size: 12px;
  }
}

/* =========================================================
   Dashboard table cleanup: controlled column widths
   ========================================================= */

#dynamicTablesWrapper {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 8px;
}

.data-table {
  width: 100%;
  overflow: visible !important;
}

/* Important: do NOT use width:max-content here.
   It lets long address text control the whole table width. */
.data-table table,
.data-table-table {
  width: 100% !important;
  min-width: 1080px;
  table-layout: fixed !important;
  border-collapse: collapse;
}

/* General cells */
.data-table th,
.data-table td {
  vertical-align: middle !important;
  line-height: 1.15;
  overflow: hidden;
}

/* Reset old nth-child sizing so it does not accidentally hit Follow-up or other dynamic columns */
.data-table th:nth-child(4),
.data-table td:nth-child(4),
.data-table th:nth-child(5),
.data-table td:nth-child(5),
.data-table th:nth-child(6),
.data-table td:nth-child(6) {
  width: auto;
}

/* Address column: compact and controlled */
.data-table th.gs-col-address,
.data-table td.gs-col-address {
  width: 210px !important;
  min-width: 210px !important;
  max-width: 210px !important;
}

.data-table td.gs-col-address,
.data-table td.gs-col-address > * {
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.1 !important;
}

.data-table td.gs-col-address > span,
.data-table td.gs-col-address .gs-table-address {
  display: block;
  max-width: 100%;
  line-height: 1.1 !important;
}

/* Contact column */
.data-table th.gs-col-contact,
.data-table td.gs-col-contact {
  width: 145px !important;
  min-width: 145px !important;
  max-width: 145px !important;
}

/* Phase column needs room, but should not steal from the table */
.data-table th.gs-col-phase,
.data-table td.gs-col-phase {
  width: 260px !important;
  min-width: 260px !important;
  max-width: 260px !important;
  text-align: center;
}

/* Dropdown / contractor style columns */
.data-table th.gs-col-dropdown,
.data-table td.gs-col-dropdown {
  width: 220px !important;
  min-width: 220px !important;
  max-width: 220px !important;
}

/* Email status */
.data-table th.gs-col-email-status,
.data-table td.gs-col-email-status {
  width: 110px !important;
  min-width: 110px !important;
  max-width: 110px !important;
  text-align: center;
}

/* Email date columns */
.data-table th.gs-col-email-date,
.data-table td.gs-col-email-date {
  width: 175px !important;
  min-width: 175px !important;
  max-width: 175px !important;
  white-space: nowrap;
}

/* Follow-up status */
.data-table th.gs-col-email-followup,
.data-table td.gs-col-email-followup {
  width: 115px !important;
  min-width: 115px !important;
  max-width: 115px !important;
  text-align: center;
}

/* Email metric pills should not stretch the column */
.gs-email-column-value {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gs-email-column-value.status {
  white-space: nowrap;
}


/* Mobile / smaller screens */
@media (max-width: 900px) {
  .data-table table,
  .data-table-table {
    min-width: 1020px;
  }

  .data-table th.gs-col-address,
  .data-table td.gs-col-address {
    width: 185px !important;
    min-width: 185px !important;
    max-width: 185px !important;
  }

  .data-table th.gs-col-phase,
  .data-table td.gs-col-phase {
    width: 235px !important;
    min-width: 235px !important;
    max-width: 235px !important;
  }

  .data-table th.gs-col-dropdown,
  .data-table td.gs-col-dropdown {
    width: 190px !important;
    min-width: 190px !important;
    max-width: 190px !important;
  }

  .actions-col-header,
  .row-actions-cell {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
  }

  .row-actions-cell {
    opacity: 1;
  }
}

/* =========================================================
   Contact icon actions + row menu clipping fix + cell padding
   ========================================================= */

/* Add breathing room inside table cells */
.data-table th,
.data-table td {
  padding: 12px 14px !important;
}


/* Compact contact cell */
.contact-cell {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 92px;
  max-width: 150px;
  line-height: 1.1;
}

.contact-name {
  font-weight: 800;
  line-height: 1.1;
  white-space: normal;
  overflow-wrap: anywhere;
}

.contact-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

/* Restore the small circle icon buttons */
.contact-icon-btn {
  appearance: none;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(28, 35, 41, 0.16);
  background: rgba(28, 35, 41, 0.05);
  color: var(--gs-charcoal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
  flex: 0 0 auto;
}

.contact-icon-btn:hover {
  background: rgba(255, 102, 66, 0.14);
  border-color: rgba(255, 102, 66, 0.38);
  color: var(--gs-charcoal);
}

.contact-phone-icon {
  cursor: help;
}

.contact-email-icon {
  cursor: pointer;
}

/* Address stays compact even with added padding */
.data-table td.gs-col-address,
.data-table td.gs-col-address > * {
  line-height: 1.1 !important;
}


/* Smaller screen adjustments */
@media (max-width: 900px) {
  .data-table th,
  .data-table td {
    padding: 10px 12px !important;
  }

  .actions-col-header,
  .row-actions-cell {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    padding: 0 3px !important;
  }

  .row-actions-cell {
    opacity: 1;
  }

  .row-menu-btn {
    width: 24px;
    height: 24px;
    font-size: 17px;
  }
}

/* =========================================================
   Row action menu - single source of truth
   This replaces all duplicate row action/menu rules above.
   Works with either:
   1) menu appended to document.body, or
   2) menu still inside .row-menu-wrap as a fallback.
   ========================================================= */

/* Let the action menu escape table rows if it has not been portaled yet. */
#dynamicTablesWrapper,
.data-table,
.data-table table,
.data-table tbody,
.data-table tr,
.data-table td {
  overflow: visible !important;
}

/* Keep the actions column thin. */
.actions-col-header,
.row-actions-cell {
  width: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;
  padding: 0 4px !important;
  text-align: center !important;
}

.row-actions-cell {
  position: relative;
  vertical-align: middle !important;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 1;
}

.data-table tr:hover .row-actions-cell,
.data-table tr.menu-open .row-actions-cell {
  opacity: 1;
}

.data-table tr.menu-open {
  position: relative;
  z-index: 2000;
}

.row-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  overflow: visible !important;
}

.row-menu-wrap.open {
  z-index: 999999;
}

.row-menu-btn {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(28, 35, 41, 0.14);
  border-radius: 999px;
  background: #ffffff;
  color: #1c2329;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  opacity: 0.9;
}

.row-menu-btn:hover,
.row-menu-wrap.open .row-menu-btn {
  background: rgba(255, 102, 66, 0.12);
  border-color: rgba(255, 102, 66, 0.45);
  opacity: 1;
}

/* Shared menu look. */
.row-menu-dropdown {
  min-width: 150px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(28, 35, 41, 0.14);
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(28, 35, 41, 0.22);
  overflow: visible !important;
  pointer-events: auto;
}

/* Fallback: if JS still appends menu inside the row, position it above the row stack. */
.row-menu-wrap > .row-menu-dropdown {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  right: 0 !important;
  z-index: 999999 !important;
}

/* Preferred: if JS portals the menu to body, this wins. */
body > .row-menu-dropdown {
  position: fixed !important;
  z-index: 999999 !important;
}

.row-menu-item,
body > .row-menu-dropdown .row-menu-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: #1c2329;
  border-radius: 9px;
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.row-menu-item:hover,
body > .row-menu-dropdown .row-menu-item:hover {
  background: rgba(255, 102, 66, 0.12);
}

@media (max-width: 900px) {
  .actions-col-header,
  .row-actions-cell {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    padding: 0 3px !important;
  }

  .row-actions-cell {
    opacity: 1;
  }

  .row-menu-btn {
    width: 24px;
    height: 24px;
    font-size: 17px;
  }

  .row-menu-dropdown {
    min-width: 132px;
  }
}

/* =========================================================
   Dashboard table width + overflow fix
   Prevents dropdown/text overlap and allows horizontal scroll
========================================================= */

#dynamicTablesWrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 12px;
}

/* Each rendered table can now be wider than the screen */
#dynamicTablesWrapper .data-table {
  width: max-content !important;
  min-width: 100% !important;
  max-width: none !important;
  overflow: visible !important;
}

/* JS sets --gs-dashboard-table-min-width per table */
#dynamicTablesWrapper .data-table table.data-table-table {
  width: max-content !important;
  min-width: var(--gs-dashboard-table-min-width, 1080px) !important;
  max-width: none !important;
  table-layout: fixed !important;
  border-collapse: collapse;
}

/* Undo the older overflow-visible table-cell rule for normal cells.
   The row menu is portaled to body, so normal cells should clip safely. */
#dynamicTablesWrapper .data-table th:not(.actions-col-header),
#dynamicTablesWrapper .data-table td:not(.row-actions-cell) {
  overflow: hidden !important;
}

/* Keep the action column available for the button itself */
#dynamicTablesWrapper .data-table th.actions-col-header,
#dynamicTablesWrapper .data-table td.row-actions-cell {
  overflow: visible !important;
}

/* Text cells: never spill into the next column */
#dynamicTablesWrapper .data-table td.gs-col-text > span,
#dynamicTablesWrapper .data-table td.gs-col-text > div,
#dynamicTablesWrapper .data-table td.gs-field-col > span,
#dynamicTablesWrapper .data-table td.gs-field-col > div {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Default text can wrap naturally, but long unbroken values will not overlap */
#dynamicTablesWrapper .data-table td.gs-col-text > span,
#dynamicTablesWrapper .data-table td.gs-col-text > div {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.15;
}

/* SKU/model/link/price-style fields should stay compact */
#dynamicTablesWrapper .data-table td[class*="gs-col-key-sku"] > *,
#dynamicTablesWrapper .data-table td[class*="gs-col-key-model"] > *,
#dynamicTablesWrapper .data-table td[class*="gs-col-key-part"] > *,
#dynamicTablesWrapper .data-table td[class*="gs-col-key-serial"] > *,
#dynamicTablesWrapper .data-table td[class*="gs-col-key-code"] > *,
#dynamicTablesWrapper .data-table td[class*="gs-col-key-link"] > *,
#dynamicTablesWrapper .data-table td[class*="gs-col-key-url"] > *,
#dynamicTablesWrapper .data-table td[class*="gs-col-key-price"] > *,
#dynamicTablesWrapper .data-table td[class*="gs-col-key-cost"] > *,
#dynamicTablesWrapper .data-table td[class*="gs-col-key-amount"] > *,
#dynamicTablesWrapper .data-table td[class*="gs-col-key-total"] > * {
  display: block;
  max-width: 100%;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Dropdown cells: give the pill full usable width */
#dynamicTablesWrapper .data-table td.gs-col-dropdown {
  padding: 12px 14px !important;
}

#dynamicTablesWrapper .status-cell-wrapper {
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 42px;
  display: flex;
  align-items: center;
}

#dynamicTablesWrapper .status-cell-wrapper > .custom-dropdown {
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 42px;
  display: flex;
  align-items: stretch;
}

#dynamicTablesWrapper .custom-dropdown-selected {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  height: 42px;
  border-radius: 8px;
  padding: 0 12px;
  box-sizing: border-box;
  overflow: hidden;
}

#dynamicTablesWrapper .custom-dropdown-selected span {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dropdown option list should remain readable */
#dynamicTablesWrapper .custom-dropdown-options {
  min-width: max(170px, 100%);
  max-width: 280px;
  overflow: hidden !important;
}

#dynamicTablesWrapper .custom-dropdown-option {
  min-height: 38px;
  padding: 10px 12px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.15;
}

/* Address still wraps compactly */
#dynamicTablesWrapper .data-table td.gs-col-address,
#dynamicTablesWrapper .data-table td.gs-col-address > * {
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.1 !important;
}

/* Contact remains compact and safe */
#dynamicTablesWrapper .contact-cell {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

#dynamicTablesWrapper .contact-name,
#dynamicTablesWrapper .contact-info {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The action menu is already appended to body in JS, so keep it above everything */
body > .row-menu-dropdown {
  position: fixed !important;
  z-index: 999999 !important;
}

/* Mobile keeps the same horizontal scroll behavior */
@media (max-width: 900px) {
  #dynamicTablesWrapper {
    overflow-x: auto !important;
    overflow-y: visible !important;
  }

  #dynamicTablesWrapper .data-table {
    width: max-content !important;
    min-width: 100% !important;
  }

  #dynamicTablesWrapper .data-table table.data-table-table {
    width: max-content !important;
    min-width: var(--gs-dashboard-table-min-width, 1020px) !important;
  }
}

/* =========================================================
   Final dropdown + actions column fixes
   ========================================================= */

/* Actions column: keep the button inside the table edge */
#dynamicTablesWrapper .data-table col.actions-col-header,
#dynamicTablesWrapper .data-table th.actions-col-header,
#dynamicTablesWrapper .data-table td.row-actions-cell,
.actions-col-header,
.row-actions-cell {
  width: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;
}

#dynamicTablesWrapper .data-table td.row-actions-cell,
.row-actions-cell {
  padding: 0 !important;
  text-align: center !important;
  vertical-align: middle !important;
  overflow: visible !important;
}

.row-menu-wrap {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Just the three dots — no circle, background, or border */
.row-menu-btn,
.row-menu-btn:hover,
.row-menu-wrap.open .row-menu-btn {
  appearance: none;
  width: 22px !important;
  height: 28px !important;
  min-width: 22px !important;
  min-height: 28px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none;
  color: var(--gs-charcoal);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px !important;
  font-weight: 800;
  line-height: 1;
  opacity: 0.78;
}

.row-menu-btn:hover,
.row-menu-wrap.open .row-menu-btn {
  opacity: 1;
}

.row-menu-btn span {
  display: block;
  line-height: 1;
  pointer-events: none;
}

/* Dropdown menus are now portaled to body by JS */
body > .custom-dropdown-options {
  position: fixed !important;
  z-index: 999999 !important;
  transform: none !important;
  background: var(--gs-card-bg, #ffffff);
  border: 1px solid var(--gs-border, rgba(28, 35, 41, 0.14));
  border-radius: 10px;
  box-shadow: var(--gs-shadow, 0 12px 30px rgba(28, 35, 41, 0.12));
  overflow: visible !important;
  pointer-events: auto;
}

body > .custom-dropdown-options .custom-dropdown-option {
  min-height: 38px;
  padding: 10px 12px;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
  border-bottom: 1px solid rgba(28, 35, 41, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.15;
}

body > .custom-dropdown-options .custom-dropdown-option:last-child {
  border-bottom: none;
}

body > .custom-dropdown-options .custom-dropdown-option:hover {
  filter: brightness(95%);
}

/* =========================================================
   Phase 10 — CRM Work Queue
   ========================================================= */

.gs-crm-work-queue {
  width: 95%;
  margin: 18px auto 20px;
  background: var(--gs-card-bg);
  border: 1px solid var(--gs-border);
  border-radius: 18px;
  box-shadow: var(--gs-shadow);
  padding: 18px;
  color: var(--gs-text);
}

.gs-crm-work-queue-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.gs-crm-work-queue-eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 102, 66, 0.12);
  color: var(--gs-coral);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 8px;
}

.gs-crm-work-queue h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: var(--gs-charcoal);
}

.gs-crm-work-queue p {
  margin: 4px 0 0;
  color: var(--gs-muted);
  font-size: 13px;
}

.gs-crm-work-queue-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.gs-crm-work-queue-select {
  min-height: 36px;
  border: 1px solid var(--gs-border);
  border-radius: 10px;
  background: var(--gs-card-bg);
  color: var(--gs-text);
  padding: 0 10px;
  font-weight: 700;
  outline: none;
}

.gs-crm-work-queue-select:focus {
  border-color: var(--gs-coral);
  box-shadow: 0 0 0 3px rgba(255, 102, 66, 0.12);
}

.gs-crm-work-queue-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.gs-crm-work-stat {
  border: 1px solid var(--gs-border);
  border-radius: 14px;
  padding: 12px;
  background: rgba(225, 233, 240, 0.45);
}

.gs-crm-work-stat span {
  display: block;
  color: var(--gs-muted);
  font-size: 12px;
  font-weight: 800;
}

.gs-crm-work-stat strong {
  display: block;
  margin-top: 5px;
  font-size: 22px;
  font-weight: 900;
  color: var(--gs-charcoal);
}

.gs-crm-work-queue-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.gs-crm-work-empty {
  border: 1px dashed var(--gs-border);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  color: var(--gs-muted);
  font-weight: 700;
}

.gs-crm-work-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--gs-border);
  border-radius: 16px;
  padding: 14px;
  background: var(--gs-card-bg);
}

.gs-crm-work-item:hover {
  background: rgba(255, 102, 66, 0.06);
}

.gs-crm-work-item-main {
  min-width: 0;
  flex: 1;
}

.gs-crm-work-item-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.gs-crm-work-item-top strong {
  color: var(--gs-charcoal);
  font-size: 15px;
  font-weight: 900;
}

.gs-crm-work-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  background: rgba(28, 35, 41, 0.08);
  color: var(--gs-charcoal);
}

.gs-crm-work-badge.overdue_follow_up {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.gs-crm-work-badge.due_follow_up {
  background: rgba(255, 102, 66, 0.14);
  color: var(--gs-coral);
}

.gs-crm-work-badge.recent_reply {
  background: rgba(34, 197, 94, 0.14);
  color: #15803d;
}

.gs-crm-work-badge.pending_follow_up {
  background: rgba(30, 48, 68, 0.12);
  color: var(--gs-navy);
}

.gs-crm-work-item-meta,
.gs-crm-work-item-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
  color: var(--gs-muted);
  font-size: 12px;
  font-weight: 700;
}

.gs-crm-work-item-meta span:not(:last-child)::after {
  content: "•";
  margin-left: 8px;
  opacity: 0.65;
}

.gs-crm-work-item-actions {
  flex: 0 0 auto;
}

@media (max-width: 900px) {
  .gs-crm-work-queue {
    width: calc(100% - 20px);
    padding: 14px;
  }

  .gs-crm-work-queue-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gs-crm-work-item {
    align-items: stretch;
    flex-direction: column;
  }

  .gs-crm-work-item-actions {
    width: 100%;
  }

  .gs-crm-work-item-actions .gs-action-btn {
    width: 100%;
  }
}

/* =========================================================
   Phase 11E — Table header cleanup
   - Change table header color
   - Hide duplicate table name row text
   - Improve email status tag padding
   ========================================================= */

/* Main column header color */
#dynamicTablesWrapper .data-table th {
  background: var(--gs-charcoal) !important;
  color: var(--gs-text-white) !important;
  border-bottom: 2px solid var(--gs-coral);
}

/* Top table meta/header row */
#dynamicTablesWrapper .table-meta-row th {
  background: var(--gs-mist) !important;
  color: var(--gs-charcoal) !important;
}

/* Hide duplicate table title inside the table header */
#dynamicTablesWrapper .table-meta-title,
#dynamicTablesWrapper .table-meta-bar > b,
#dynamicTablesWrapper .table-meta-bar > strong {
  display: none !important;
}

/* Let bulk toolbar sit cleanly after removing the duplicate title */
#dynamicTablesWrapper .table-meta-bar {
  justify-content: flex-start !important;
  align-items: center !important;
  gap: 14px !important;
}

/* Keep the bulk toolbar readable on the dark header */
#dynamicTablesWrapper .gs-bulk-toolbar,
#dynamicTablesWrapper .gs-bulk-selected-count{
  color: var(--gs-charcoal) !important;
}

/* More padding for email status tags like Replied / Not Sent */
#dynamicTablesWrapper .gs-email-column-value.status {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 7px 13px !important;
  border-radius: 999px;
  line-height: 1.1;
  white-space: nowrap;
}

/* Replied tag */
#dynamicTablesWrapper .gs-email-column-value.status.replied,
#dynamicTablesWrapper .gs-email-column-value.status.received_reply {
  background: rgba(255, 102, 66, 0.14) !important;
  color: var(--gs-coral) !important;
}

/* Not Sent tag */
#dynamicTablesWrapper .gs-email-column-value.status.none,
#dynamicTablesWrapper .gs-email-column-value.status.not_sent {
  background: rgba(28, 35, 41, 0.08) !important;
  color: var(--gs-muted) !important;
}