/* Communications hub - reuse corporate / event-admin shell (--cum-* from corporate-user-management.css) */

/* Desktop tab toggle visible by default; mobile picker hidden. */
.communications-tab--desktop {
  flex: 1 1 auto;
  min-width: 0;
}

.communications-tab--mobile {
  display: none;
  flex: 1 1 auto;
  min-width: 0;
}

/* xs/sm/md tier (max-width 1023.98px mirrors --bp-lg). Swap desktop tabs for
   GenericDropdown picker. Media queries can't deref CSS vars. */
@media (max-width: 1023.98px) {
  .communications-tab--desktop {
    display: none;
  }

  .communications-tab--mobile {
    display: flex;
  }
}

/* Split grid: fixed header + scrollable tbody + fixed totals footer (Inventory pattern) */
.com-email-grid-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.com-email-grid-flex {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
}

.com-email-head-table,
.com-email-foot-table {
  flex-shrink: 0;
  table-layout: fixed;
  width: 100%;
}

.com-email-body-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.com-email-body-scroll .cum-table {
  table-layout: fixed;
  width: 100%;
}

.com-email-col-campaign {
  width: 30%;
}

.com-email-col-sent {
  width: 18%;
}

.com-email-col-num {
  width: 13%;
}

.com-email-totals-label {
  font-weight: 600;
}

.com-email-totals-sent {
  color: var(--cum-muted-foreground, #808c91);
  font-size: var(--cum-text-label, 12px);
}

.com-email-foot-table tfoot td {
  font-weight: 600;
  background: var(--cum-muted, #f2ebf3);
  border-top: 2px solid var(--cum-border, #e6e8e9);
  padding: 12px 16px;
  font-size: var(--cum-text-label, 12px);
  color: var(--cum-foreground, #021922);
}

.com-email-foot-table tfoot tr {
  border-bottom: none;
}

.communications-email-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.communications-date-range-dd {
  min-width: 220px;
}

/* Email tab: PaginatedTable uses .generic-table (not .cum-table), so metric alignment needs local rules. */
.communications-email-table-host .generic-table {
  table-layout: fixed;
  width: 100%;
}

.communications-email-table-host .generic-table th,
.communications-email-table-host .generic-table td {
  text-align: right;
  vertical-align: middle;
}

.communications-email-table-host .generic-table th.com-email-col-campaign,
.communications-email-table-host .generic-table td.com-email-col-campaign {
  text-align: left;
  word-break: break-word;
  white-space: normal;
}

.communications-email-table-host .generic-table th.com-email-col-nowrap,
.communications-email-table-host .generic-table td.com-email-col-nowrap {
  white-space: nowrap;
}

.communications-email-table-host .com-email-metric-wrap {
  display: block;
  text-align: right;
}

.communications-email-table-host .com-email-metric-num {
  display: block;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.communications-email-table-host td .communications-metric-zero {
  display: inline-block;
  min-width: 1.25em;
}

.communications-metric-btn {
  background: transparent;
  border: 0;
  outline: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--cum-primary);
  text-decoration: none;
  cursor: pointer;
  text-align: right;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}

.communications-metric-btn:hover,
.communications-metric-btn:focus {
  color: var(--cum-primary-hover);
  text-decoration: none;
  outline: none;
  box-shadow: none;
}

.communications-metric-zero {
  color: var(--cum-muted-foreground, #808c91);
}

.communications-engagement-preview .communications-engagement-loading {
  margin: 0;
  color: var(--cum-muted-foreground, #808c91);
}

.communications-engagement-table-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.communications-engagement-table {
  font-size: 13px;
}

.communications-engagement-table th,
.communications-engagement-table td {
  word-break: break-word;
}

.communications-email-link {
  color: var(--cum-primary);
  text-decoration: none;
}

.communications-email-link:hover {
  text-decoration: underline;
}

.communications-engagement-count {
  margin: 0;
  font-size: 12px;
}

.communications-placeholder-block {
  max-width: 520px;
  padding: 8px 0 24px;
}

.communications-placeholder-block h2 {
  font-size: 1.1rem;
  margin: 0 0 8px;
}

.communications-template-list {
  margin: 0;
  padding-left: 1.25rem;
}

.communications-template-list li {
  margin-bottom: 6px;
}

/* xs/sm tier (<= --bp-md = 768). 767.98 mirrors --bp-md; @media can't deref vars. */
@media (max-width: 767.98px) {
  .communications-engagement-table,
  .communications-engagement-table thead,
  .communications-engagement-table tbody,
  .communications-engagement-table tr,
  .communications-engagement-table th,
  .communications-engagement-table td {
    display: block;
    width: 100%;
  }

  .communications-engagement-table thead {
    display: none;
  }

  .communications-engagement-table tr {
    padding: 12px;
    border: 1px solid var(--cum-border, #e6e8e9);
    border-radius: 12px;
    background: var(--cum-card, #fff);
  }

  .communications-engagement-table td {
    padding: 6px 0;
    border: none;
  }

  .communications-engagement-table td::before {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--cum-muted-foreground, #808c91);
  }

  .communications-engagement-table td:nth-child(1)::before {
    content: "Name";
  }

  .communications-engagement-table td:nth-child(2)::before {
    content: "Email";
  }
}

