/* JENX CoreOpsX v4.0.2 — site-wide control + table consistency */

/* Native check/radio controls must never inherit text-field sizing. */
input[type="checkbox"]:not([role="switch"]),
input[type="radio"]:not([role="switch"]) {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  padding: 0 !important;
  margin: 0;
  box-sizing: border-box;
  flex: 0 0 16px;
  vertical-align: middle;
  accent-color: #ed1c24;
}

.check,
.compact-check,
.admin-row-check,
.permission-grid label,
.permission-group label,
.dashboard-role-checks label,
.security-policy-checks label,
.multi-team-options label.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  line-height: 1.35;
}

.compact-check { min-height: 28px; gap: 6px; }

th > input[type="checkbox"],
td > input[type="checkbox"],
th > input[type="radio"],
td > input[type="radio"] {
  display: inline-block;
  vertical-align: middle;
}

.site-contact-alert-cell .check,
.site-contact-alert-cell .compact-check {
  justify-content: flex-start;
  width: auto;
}

/* Stable tables even when drag/column adjustment is unavailable or disabled. */
.tablewrap.coreopsx-tablewrap-stable,
.tablewrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.tablewrap > table.coreopsx-table-stable {
  min-width: 100% !important;
  table-layout: auto;
}

.tablewrap > table.coreopsx-table-stable:not(.table-column-resizable),
.tablewrap > table.table-natural-layout {
  width: max-content !important;
  min-width: 100% !important;
  max-width: none !important;
}

.tablewrap > table.coreopsx-table-stable th,
.tablewrap > table.coreopsx-table-stable td {
  box-sizing: border-box;
}

.tablewrap > table.coreopsx-table-stable th {
  white-space: nowrap;
}

.tablewrap > table.coreopsx-table-stable td {
  overflow-wrap: anywhere;
  word-break: normal;
}

.tablewrap .table-actions,
.tablewrap .toolbar-actions {
  align-items: center;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .tablewrap > table.coreopsx-table-stable:not(.table-column-resizable),
  .tablewrap > table.table-natural-layout {
    min-width: max(100%, 680px) !important;
  }
}

/* CoreOpsX v4.0.3 — compact Site Contact editor without desktop horizontal scroll */
.site-contacts-editor .tablewrap {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
}

.site-contacts-editor .site-contacts-table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed !important;
}

.site-contacts-editor .site-contacts-table th,
.site-contacts-editor .site-contacts-table td {
  min-width: 0 !important;
  max-width: none !important;
  padding-left: 7px;
  padding-right: 7px;
  vertical-align: middle;
}

.site-contacts-editor .site-contacts-table th:nth-child(1),
.site-contacts-editor .site-contacts-table td:nth-child(1) { width: 4%; }
.site-contacts-editor .site-contacts-table th:nth-child(2),
.site-contacts-editor .site-contacts-table td:nth-child(2) { width: 15%; }
.site-contacts-editor .site-contacts-table th:nth-child(3),
.site-contacts-editor .site-contacts-table td:nth-child(3) { width: 15%; }
.site-contacts-editor .site-contacts-table th:nth-child(4),
.site-contacts-editor .site-contacts-table td:nth-child(4) { width: 13%; }
.site-contacts-editor .site-contacts-table th:nth-child(5),
.site-contacts-editor .site-contacts-table td:nth-child(5) { width: 18%; }
.site-contacts-editor .site-contacts-table th:nth-child(6),
.site-contacts-editor .site-contacts-table td:nth-child(6) { width: 10%; }
.site-contacts-editor .site-contacts-table th:nth-child(7),
.site-contacts-editor .site-contacts-table td:nth-child(7) { width: 15%; }
.site-contacts-editor .site-contacts-table th:nth-child(8),
.site-contacts-editor .site-contacts-table td:nth-child(8) { width: 10%; }

.site-contacts-editor .site-contacts-table input[type="text"],
.site-contacts-editor .site-contacts-table input[type="tel"],
.site-contacts-editor .site-contacts-table input[type="email"],
.site-contacts-editor .site-contacts-table select {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 40px;
  box-sizing: border-box;
}

.site-contacts-editor .site-contact-alert-cell {
  padding-left: 7px !important;
  padding-right: 7px !important;
}

.site-contacts-editor .site-contact-alert-cell .compact-check {
  width: 100% !important;
  min-width: 0 !important;
  height: 40px;
  min-height: 40px;
  padding: 0 9px;
  margin: 0;
  border: 1px solid #c9d5e4;
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
  justify-content: flex-start;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}

.site-contacts-editor .site-contact-alert-cell .compact-check input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  flex: 0 0 16px;
}

.site-contacts-editor .line-item-action-set {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  flex-wrap: wrap;
}

.site-contacts-editor .line-item-action-set .btn.small {
  min-width: 0;
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .site-contacts-editor .tablewrap {
    overflow-x: auto !important;
  }
  .site-contacts-editor .site-contacts-table {
    min-width: 760px !important;
  }
}


/* CoreOpsX v4.0.4 — definitive compact Site Contact sizing + desktop no-scroll override.
   This intentionally outranks the generic coreopsx-table-stable max-content rule. */
.site-contacts-editor .tablewrap.coreopsx-tablewrap-stable,
.site-contacts-editor > .tablewrap {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
  scrollbar-width: none;
}
.site-contacts-editor .tablewrap.coreopsx-tablewrap-stable::-webkit-scrollbar,
.site-contacts-editor > .tablewrap::-webkit-scrollbar { display: none; }

.site-contacts-editor .tablewrap > table.site-contacts-table.coreopsx-table-stable,
.site-contacts-editor .tablewrap > table.site-contacts-table.coreopsx-table-stable:not(.table-column-resizable),
.site-contacts-editor .tablewrap > table.site-contacts-table.table-natural-layout,
.site-contacts-editor .tablewrap > table.site-contacts-table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed !important;
}

.site-contacts-editor .site-contacts-table th,
.site-contacts-editor .site-contacts-table td {
  min-width: 0 !important;
  max-width: none !important;
  padding: 6px 5px !important;
  box-sizing: border-box;
  vertical-align: middle;
}

/* Total = 100%. Keep all fields visible in the card without desktop scrolling. */
.site-contacts-editor .site-contacts-table th:nth-child(1),
.site-contacts-editor .site-contacts-table td:nth-child(1) { width: 3% !important; }
.site-contacts-editor .site-contacts-table th:nth-child(2),
.site-contacts-editor .site-contacts-table td:nth-child(2) { width: 14% !important; }
.site-contacts-editor .site-contacts-table th:nth-child(3),
.site-contacts-editor .site-contacts-table td:nth-child(3) { width: 15% !important; }
.site-contacts-editor .site-contacts-table th:nth-child(4),
.site-contacts-editor .site-contacts-table td:nth-child(4) { width: 13% !important; }
.site-contacts-editor .site-contacts-table th:nth-child(5),
.site-contacts-editor .site-contacts-table td:nth-child(5) { width: 17% !important; }
.site-contacts-editor .site-contacts-table th:nth-child(6),
.site-contacts-editor .site-contacts-table td:nth-child(6) { width: 10% !important; }
.site-contacts-editor .site-contacts-table th:nth-child(7),
.site-contacts-editor .site-contacts-table td:nth-child(7) { width: 17% !important; }
.site-contacts-editor .site-contacts-table th:nth-child(8),
.site-contacts-editor .site-contacts-table td:nth-child(8) { width: 11% !important; }

.site-contacts-editor .site-contacts-table th {
  font-size: 10.5px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-contacts-editor .site-contacts-table input[type="text"],
.site-contacts-editor .site-contacts-table input[type="tel"],
.site-contacts-editor .site-contacts-table input[type="email"],
.site-contacts-editor .site-contacts-table select {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 5px 8px !important;
  font-size: 11.5px !important;
  line-height: 1.2;
  box-sizing: border-box !important;
}

.site-contacts-editor .site-contact-alert-cell .compact-check {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 7px !important;
  gap: 5px !important;
  border-radius: 7px;
  font-size: 10.5px !important;
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
}
.site-contacts-editor .site-contact-alert-cell .compact-check input[type="checkbox"] {
  width: 15px !important;
  height: 15px !important;
  min-width: 15px !important;
  min-height: 15px !important;
  max-width: 15px !important;
  max-height: 15px !important;
  flex: 0 0 15px !important;
}

.site-contacts-editor .line-item-action-set {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 4px !important;
  flex-wrap: nowrap !important;
  min-width: 0 !important;
}
.site-contacts-editor .line-item-action-set .btn.small {
  min-width: 0 !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 4px 6px !important;
  font-size: 10px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

/* Keep the add action compact and aligned to the editor edge. */
.site-contacts-editor .line-item-addbar {
  margin-top: 8px !important;
  justify-content: flex-end;
}
.site-contacts-editor .line-item-addbar .btn.small {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 10.5px;
}

/* On smaller screens the form may scroll rather than becoming unreadably narrow. */
@media (max-width: 760px) {
  .site-contacts-editor .tablewrap.coreopsx-tablewrap-stable,
  .site-contacts-editor > .tablewrap { overflow-x: auto !important; scrollbar-width: auto; }
  .site-contacts-editor .tablewrap > table.site-contacts-table.coreopsx-table-stable,
  .site-contacts-editor .tablewrap > table.site-contacts-table { min-width: 720px !important; }
}

/* CoreOpsX v4.0.5 — notification rules: centrally managed body + compact aligned controls */
.v28.ops-nexus .email-rule-list{
  display:grid;
  gap:9px;
  margin-top:10px;
}

.v28.ops-nexus .email-rule-row{
  min-width:0;
  margin:0;
  padding:10px 11px;
  border:1px solid var(--line,#d7e1ec);
  border-radius:10px;
  background:var(--card,#fff);
  box-sizing:border-box;
}

.v28.ops-nexus .email-rule-row.email-rule-workflow{
  display:grid !important;
  grid-template-columns:minmax(170px,210px) minmax(0,1fr) minmax(260px,340px) 136px !important;
  grid-template-areas:"head recipients subject save" !important;
  gap:10px 11px !important;
  align-items:end !important;
}

.v28.ops-nexus .email-rule-row.email-rule-simple{
  display:grid !important;
  grid-template-columns:minmax(240px,300px) minmax(320px,1fr) 136px !important;
  gap:10px 12px !important;
  align-items:end !important;
}

.v28.ops-nexus .email-rule-row>.email-rule-head{
  min-width:0;
  align-self:start !important;
  display:grid;
  gap:3px;
  align-content:start;
  padding:0;
}

.v28.ops-nexus .email-rule-workflow>.email-rule-head{grid-area:head !important}
.v28.ops-nexus .email-rule-workflow>.notification-recipient-grid{grid-area:recipients !important}
.v28.ops-nexus .email-rule-workflow>.email-rule-subject{grid-area:subject !important}
.v28.ops-nexus .email-rule-workflow>.email-rule-save{grid-area:save !important}

.v28.ops-nexus .email-rule-row>.email-rule-head .check{
  width:auto !important;
  min-height:34px !important;
  height:auto !important;
  margin:0 0 2px !important;
  padding:6px 8px !important;
  border:1px solid var(--line,#d7e1ec);
  border-radius:8px;
  background:var(--surface-soft,#f8fafc);
  box-sizing:border-box;
  justify-content:flex-start;
  font-size:10.5px;
}

.v28.ops-nexus .email-rule-row>.email-rule-head strong{
  font-size:12px !important;
  line-height:1.25 !important;
  color:var(--ink,#17191d);
}
.v28.ops-nexus .email-rule-row>.email-rule-head small{
  font-size:9.5px !important;
  line-height:1.2 !important;
  color:var(--muted,#6f737b);
}

.v28.ops-nexus .email-rule-workflow>.notification-recipient-grid{
  min-width:0;
  align-self:start;
  display:grid !important;
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  gap:6px !important;
  padding:8px !important;
  border:1px solid var(--line,#d7e1ec) !important;
  border-radius:8px !important;
  background:var(--surface-soft,#f8fafc) !important;
  box-sizing:border-box;
}
.v28.ops-nexus .email-rule-workflow>.notification-recipient-grid>strong{
  grid-column:1/-1 !important;
  width:auto !important;
  margin:0 0 2px !important;
  font-size:10.5px !important;
  line-height:1.2 !important;
}
.v28.ops-nexus .email-rule-workflow>.notification-recipient-grid .check{
  min-width:0;
  width:100% !important;
  min-height:42px !important;
  height:42px !important;
  margin:0 !important;
  padding:6px 8px !important;
  display:flex !important;
  align-items:center !important;
  gap:7px !important;
  border:1px solid var(--line,#d7e1ec);
  border-radius:7px;
  background:var(--card,#fff);
  box-sizing:border-box;
  overflow:hidden;
  white-space:normal;
  font-size:10.25px !important;
  line-height:1.2 !important;
}
.v28.ops-nexus .email-rule-workflow>.notification-recipient-grid .check input{
  flex:0 0 16px !important;
  width:16px !important;
  height:16px !important;
  min-width:16px !important;
  min-height:16px !important;
  margin:0 !important;
}

.v28.ops-nexus .email-rule-row>.email-rule-subject{
  min-width:0;
  margin:0;
  display:grid !important;
  gap:5px !important;
  align-self:end !important;
  font-size:10.5px !important;
  line-height:1.2 !important;
}
.v28.ops-nexus .email-rule-row>.email-rule-subject input{
  width:100% !important;
  min-width:0 !important;
  min-height:38px !important;
  height:38px !important;
  margin:0 !important;
  padding:7px 9px !important;
  box-sizing:border-box;
  font-size:11px !important;
}

.v28.ops-nexus .email-rule-row>.email-rule-save{
  width:136px !important;
  min-width:136px !important;
  min-height:38px !important;
  height:38px !important;
  margin:0 !important;
  padding:6px 8px !important;
  align-self:end !important;
  justify-self:end !important;
  white-space:nowrap;
  font-size:9.75px !important;
}

/* No legacy Body Template field is rendered from v4.0.5 onward. */
.v28.ops-nexus .email-rule-row>label.span2{display:none !important}

@media(max-width:1180px){
  .v28.ops-nexus .email-rule-row.email-rule-workflow{
    grid-template-columns:minmax(190px,230px) minmax(0,1fr) !important;
    grid-template-areas:
      "head recipients"
      "subject subject"
      ". save" !important;
  }
  .v28.ops-nexus .email-rule-workflow>.notification-recipient-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
  .v28.ops-nexus .email-rule-row.email-rule-simple{
    grid-template-columns:minmax(230px,280px) minmax(0,1fr) 136px !important;
  }
}

@media(max-width:760px){
  .v28.ops-nexus .email-rule-row.email-rule-workflow,
  .v28.ops-nexus .email-rule-row.email-rule-simple{
    grid-template-columns:1fr !important;
  }
  .v28.ops-nexus .email-rule-row.email-rule-workflow{
    grid-template-areas:"head" "recipients" "subject" "save" !important;
  }
  .v28.ops-nexus .email-rule-workflow>.notification-recipient-grid{
    grid-template-columns:1fr !important;
  }
  .v28.ops-nexus .email-rule-workflow>.notification-recipient-grid>strong{
    grid-column:1 !important;
  }
  .v28.ops-nexus .email-rule-row>.email-rule-save{
    width:100% !important;
    min-width:0 !important;
    justify-self:stretch !important;
  }
}


/* v4.0.6 — compact ticket Status multi-select. */
.v28.ops-nexus .ticket-queue-filters .ticket-status-filter-label{
  min-width:210px;
  position:relative;
}
.v28.ops-nexus .ticket-status-multiselect{
  position:relative;
  width:100%;
  min-width:210px;
}
.v28.ops-nexus .ticket-status-multiselect>summary{
  list-style:none;
  min-height:38px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:8px 11px;
  border:1px solid var(--line,#d7e1ec);
  border-radius:8px;
  background:var(--card,#fff);
  color:var(--ink,#17191d);
  box-sizing:border-box;
  cursor:pointer;
  font-size:12px;
  font-weight:600;
}
.v28.ops-nexus .ticket-status-multiselect>summary::-webkit-details-marker{display:none}
.v28.ops-nexus .ticket-status-multiselect[open]>summary{
  border-color:var(--primary,#ed1c24);
  box-shadow:0 0 0 2px color-mix(in srgb,var(--primary,#ed1c24) 12%,transparent);
}
.v28.ops-nexus .ticket-status-chevron{font-size:14px;line-height:1;transition:transform .15s ease}
.v28.ops-nexus .ticket-status-multiselect[open] .ticket-status-chevron{transform:rotate(180deg)}
.v28.ops-nexus .ticket-status-menu{
  position:absolute;
  z-index:80;
  top:calc(100% + 5px);
  left:0;
  width:max(100%,240px);
  max-height:330px;
  overflow:auto;
  padding:8px;
  border:1px solid var(--line,#d7e1ec);
  border-radius:9px;
  background:var(--card,#fff);
  box-shadow:0 12px 28px rgba(15,23,42,.16);
  box-sizing:border-box;
}
.v28.ops-nexus .ticket-status-actions{
  display:flex;
  gap:6px;
  padding-bottom:7px;
  margin-bottom:5px;
  border-bottom:1px solid var(--line,#d7e1ec);
}
.v28.ops-nexus .ticket-status-options{display:grid;gap:2px}
.v28.ops-nexus .ticket-status-option{
  min-width:0!important;
  display:flex!important;
  align-items:center;
  gap:8px;
  padding:7px 6px;
  margin:0!important;
  border-radius:6px;
  cursor:pointer;
  font-size:12px;
  font-weight:500;
}
.v28.ops-nexus .ticket-status-option:hover{background:var(--surface-soft,#f8fafc)}
.v28.ops-nexus .ticket-status-option input{
  flex:0 0 16px!important;
  width:16px!important;
  height:16px!important;
  min-width:16px!important;
  min-height:16px!important;
  margin:0!important;
}
html[data-appearance="dark"] .v28.ops-nexus .ticket-status-menu,
html[data-appearance="dark"] .v28.ops-nexus .ticket-status-multiselect>summary{background:var(--cx-panel,#111f30)!important}
@media(max-width:640px){
  .v28.ops-nexus .ticket-queue-filters .ticket-status-filter-label,
  .v28.ops-nexus .ticket-status-multiselect{width:100%;min-width:0}
  .v28.ops-nexus .ticket-status-menu{width:100%;min-width:220px}
}

/* CoreOpsX v4.0.15 — Site Contact action/add-button alignment fix */
.site-contacts-editor{
  padding-bottom:8px !important;
  overflow:visible !important;
}
.site-contacts-editor .tablewrap{
  margin-bottom:0 !important;
}
/* Give the row action cell slightly more room so Add/Edit/Delete remain inside the table. */
.site-contacts-editor .site-contacts-table th:nth-child(7),
.site-contacts-editor .site-contacts-table td:nth-child(7){width:15.5% !important;}
.site-contacts-editor .site-contacts-table th:nth-child(8),
.site-contacts-editor .site-contacts-table td:nth-child(8){width:12.5% !important;}
.site-contacts-editor .site-contacts-table td.line-item-actions{
  padding-right:7px !important;
  overflow:visible !important;
}
.site-contacts-editor .line-item-action-set{
  width:100% !important;
  max-width:100% !important;
  box-sizing:border-box !important;
  justify-content:flex-start !important;
  overflow:visible !important;
}
.site-contacts-editor .line-item-action-set .btn.small{
  flex:0 0 auto !important;
}
/* Dedicated footer row for + Add Contact Person. Never overlap table/action buttons. */
.site-contacts-editor .line-item-addbar{
  position:static !important;
  inset:auto !important;
  clear:both !important;
  display:flex !important;
  width:100% !important;
  max-width:100% !important;
  box-sizing:border-box !important;
  align-items:center !important;
  justify-content:flex-end !important;
  flex-wrap:nowrap !important;
  gap:8px !important;
  margin:10px 0 0 !important;
  padding:10px 5px 0 !important;
  border-top:1px solid var(--line) !important;
  background:transparent !important;
  z-index:auto !important;
  transform:none !important;
}
.site-contacts-editor .line-item-addbar .btn.small{
  position:static !important;
  flex:0 0 auto !important;
  width:auto !important;
  max-width:100% !important;
  min-height:32px !important;
  margin:0 !important;
  white-space:nowrap !important;
}
@media(max-width:760px){
  .site-contacts-editor .line-item-addbar{
    justify-content:flex-start !important;
    padding-left:0 !important;
    padding-right:0 !important;
  }
}
