/* Manual push notifications */
.push-admin-page {
  max-width: 1680px;
  width: min(1680px, 98vw);
}

.push-layout {
  grid-template-columns: minmax(0, 1fr) minmax(420px, .82fr);
  align-items: start;
}

.push-channel-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.push-channel-box .check-row {
  border: 1px solid rgba(15,23,42,.09);
  border-radius: 16px;
  padding: 12px;
  background: #fff;
  font-weight: 900;
}

.push-selector {
  display: grid;
  gap: 12px;
}

.push-selector-actions {
  align-items: center;
}

.push-selector-actions input {
  min-width: 0;
  flex: 1;
}

.push-recipient-list {
  display: grid;
  gap: 9px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.push-recipient-row {
  display: grid;
  grid-template-columns: auto 38px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  padding: 11px;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 18px;
  background: #fff;
  cursor: pointer;
}

.push-recipient-row.is-selected {
  border-color: rgba(28,124,84,.28);
  background: #f0fdf4;
}

.push-recipient-row.is-disabled {
  opacity: .55;
  cursor: not-allowed;
  filter: grayscale(.2);
}

.push-recipient-row input {
  width: 18px;
  height: 18px;
  accent-color: #1c7c54;
}

.recipient-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #ecfdf3;
  color: #0f7f55;
  font-weight: 1000;
}

.push-recipient-row strong,
.push-recipient-row small {
  display: block;
}

.push-recipient-row small {
  color: #64748b;
  margin-top: 2px;
  font-weight: 700;
}

.push-preview-box {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(59,130,246,.16);
  border-radius: 22px;
  background: linear-gradient(135deg,#eff6ff,#fff);
}

.push-preview-box strong,
.push-preview-box span {
  display: block;
}

.push-preview-box ul {
  margin: 12px 0 0;
  padding-left: 18px;
}

.push-history-table {
  min-width: 980px;
}

.push-history-table td strong,
.push-history-table td small {
  display: block;
}

.push-history-table td small {
  color: #64748b;
  margin-top: 4px;
  max-width: 380px;
}

@media (max-width: 1050px) {
  .push-layout {
    grid-template-columns: 1fr;
  }

  .push-channel-box {
    grid-template-columns: 1fr;
  }
}


.push-message-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

@media (max-width: 640px) {
  .push-message-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .push-message-actions .btn {
    width: 100%;
  }
}


.rich-editor-label {
  display: grid;
  gap: 8px;
}

.rich-editor-card {
  overflow: hidden;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(16,24,40,.06);
}

.rich-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid rgba(15,23,42,.08);
  background: linear-gradient(135deg, #f8fafc, #fff);
}

.rich-editor-toolbar button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  font-weight: 900;
  cursor: pointer;
}

.rich-editor-toolbar button:hover,
.rich-editor-toolbar button:focus {
  border-color: rgba(15,127,85,.28);
  color: #0f7f55;
  outline: 3px solid rgba(15,127,85,.12);
}

.toolbar-separator {
  width: 1px;
  height: 26px;
  background: rgba(15,23,42,.10);
  margin: 0 2px;
}

.rich-editor-area {
  min-height: 210px;
  padding: 16px;
  color: #0f172a;
  line-height: 1.6;
  font-size: 1rem;
  outline: none;
}

.rich-editor-area:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  font-weight: 800;
}

.rich-editor-area h3,
.rich-editor-area h4 {
  margin: 0 0 10px;
  line-height: 1.25;
}

.rich-editor-area p {
  margin: 0 0 10px;
}

.rich-editor-area ul,
.rich-editor-area ol {
  margin: 8px 0 12px 22px;
}

.rich-editor-area blockquote {
  margin: 10px 0;
  padding: 10px 13px;
  border-left: 4px solid #0f7f55;
  border-radius: 12px;
  background: #ecfdf3;
  color: #14532d;
  font-weight: 800;
}

.rich-editor-help {
  display: block;
  margin-top: 2px;
}


/* Walk reminder + WhatsApp + attachments */
.push-channel-box {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.walk-reminder-card,
.attachment-upload-box {
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid rgba(15,127,85,.16);
  border-radius: 24px;
  background: linear-gradient(135deg, #ecfdf3, #fff);
}

.walk-reminder-card .mini-head {
  margin-bottom: 0;
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(15,23,42,.10);
  font-weight: 900;
}

.attachment-chip small {
  color: #64748b;
  font-weight: 800;
}

@media (max-width: 760px) {
  .push-channel-box {
    grid-template-columns: 1fr;
  }
}


/* Pro preview + history filters */
.push-history-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) repeat(3, minmax(150px, 1fr)) repeat(2, minmax(130px, .7fr)) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.push-history-detail {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid rgba(15,127,85,.16);
  border-radius: 24px;
  background: linear-gradient(135deg, #ecfdf3, #fff);
}

.history-message-preview,
.preview-message-card {
  padding: 14px;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 20px;
  background: #fff;
  margin: 10px 0;
}

.notification-preview-pro {
  display: grid;
  gap: 12px;
}

.notification-preview-pro > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notification-preview-pro strong,
.notification-preview-pro span {
  display: block;
}

.preview-channel-row {
  width: max-content;
  max-width: 100%;
  padding: 7px 11px;
  border-radius: 999px;
  background: #0f7f55;
  color: #fff;
  font-weight: 1000;
}

.preview-message-card h3 {
  margin: 0 0 10px;
}

.preview-message-body :is(p, ul, ol, blockquote, h3, h4),
.history-message-preview :is(p, ul, ol, blockquote, h3, h4) {
  margin-top: 0;
}

.history-attachments {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.history-attachments a {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(15,23,42,.10);
  font-weight: 900;
  text-decoration: none;
}

.small-table-wrap {
  max-height: 360px;
  overflow: auto;
}

@media (max-width: 1100px) {
  .push-history-filters {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .push-history-filters {
    grid-template-columns: 1fr;
  }
}

/* Native phone push status — additive only. */
.native-push-channel-row {
  align-items: flex-start;
  flex-wrap: wrap;
}

.native-push-channel-row > small {
  flex: 0 0 100%;
  margin: 4px 0 0 28px;
  color: #64748b;
  font-size: .75rem;
  font-weight: 800;
  line-height: 1.35;
}

.native-push-channel-row > small.is-ready {
  color: #047857;
}

.native-push-channel-row > small.is-warning {
  color: #a16207;
}

.native-push-channel-row:has(input:disabled) {
  opacity: .72;
  cursor: not-allowed;
}

.native-push-channel-row input:disabled + span {
  cursor: not-allowed;
}

/* ================================================================
   Manual Notifications Pro v3
   Fixes stretched delivery/audience controls without changing logic.
   ================================================================ */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.push-admin-page {
  --push-green: #147d59;
  --push-green-dark: #0e6145;
  --push-ink: #101828;
  --push-muted: #667085;
  --push-line: #e4e7ec;
  --push-soft: #f8fafc;
}

.push-stats-grid .stat {
  min-height: 118px;
}

.push-layout {
  grid-template-columns: minmax(0, 1.32fr) minmax(360px, .68fr);
  gap: 20px;
}

.push-compose-panel,
.push-target-panel {
  min-width: 0;
}

.push-compose-panel .stack-form {
  gap: 18px;
}

.push-message-setup {
  display: grid;
  gap: 15px;
  padding: 20px;
  border: 1px solid var(--push-line);
  border-radius: 24px;
  background: linear-gradient(145deg, #fff 0%, #fbfdfc 100%);
}

.push-block-heading {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
}

.push-block-heading h3,
.push-block-heading p {
  margin-top: 0;
}

.push-block-heading h3 {
  margin-bottom: 5px;
  color: var(--push-ink);
  font-size: 1.12rem;
}

.push-block-heading .eyebrow {
  margin-bottom: 5px;
}

.push-block-heading .muted {
  margin-bottom: 0;
  line-height: 1.45;
}

.push-step-number {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(145deg, #e9f9f1, #f5fffa);
  border: 1px solid rgba(20, 125, 89, .16);
  color: var(--push-green);
  font-weight: 1000;
  box-shadow: 0 8px 22px rgba(20, 125, 89, .08);
}

.push-channel-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.push-channel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.push-channel-card {
  position: relative;
  display: grid !important;
  grid-template-columns: 38px minmax(0, 1fr) 24px;
  grid-template-areas:
    "icon copy check";
  gap: 12px;
  align-items: start;
  min-height: 138px;
  margin: 0 !important;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--push-line);
  border-radius: 20px;
  background: #fff;
  color: var(--push-ink) !important;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(16, 24, 40, .045);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}

.push-channel-card:hover {
  transform: translateY(-1px);
  border-color: rgba(20, 125, 89, .3);
  box-shadow: 0 16px 34px rgba(16, 24, 40, .075);
}

.push-channel-card.is-selected {
  border-color: rgba(20, 125, 89, .48);
  background: linear-gradient(145deg, #f2fcf7, #fff);
  box-shadow: 0 14px 34px rgba(20, 125, 89, .11);
}

.push-channel-card.is-disabled {
  background: #f9fafb;
  opacity: .76;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.push-channel-card > input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.push-channel-icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: #eef8f3;
  border: 1px solid rgba(20, 125, 89, .12);
  color: var(--push-green);
  font-size: 1.05rem;
  font-weight: 1000;
}

.push-channel-card.is-selected .push-channel-icon {
  color: #fff;
  background: var(--push-green);
  border-color: var(--push-green);
}

.push-channel-check {
  grid-area: check;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid #cfd4dc;
  border-radius: 8px;
  background: #fff;
  color: transparent;
  font-size: .78rem;
  line-height: 1;
  font-weight: 1000;
}

.push-channel-card.is-selected .push-channel-check {
  border-color: var(--push-green);
  background: var(--push-green);
  color: #fff;
}

.push-channel-card:focus-within {
  outline: 3px solid rgba(20, 125, 89, .14);
  outline-offset: 2px;
}

.push-channel-copy {
  grid-area: copy;
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}

.push-channel-copy > strong {
  color: var(--push-ink);
  font-size: 1rem;
  line-height: 1.25;
}

.push-channel-copy > small {
  display: block;
  color: var(--push-muted);
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.push-channel-status,
.push-platform-statuses .push-channel-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 25px;
  margin: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #475467;
  font-size: .69rem;
  font-style: normal;
  font-weight: 950;
  line-height: 1.15;
  white-space: normal;
}

.push-channel-status.is-ready {
  background: #dcfae6;
  color: #067647;
}

.push-channel-status.is-warning {
  background: #fef0c7;
  color: #b54708;
}

.push-channel-status.is-error {
  background: #fee4e2;
  color: #b42318;
}

.push-platform-statuses {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.native-push-channel-row > small,
.native-push-channel-row .push-channel-copy > small {
  flex: initial;
  margin: 0;
  color: var(--push-muted);
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.42;
}

.push-audience-field {
  display: grid !important;
  gap: 7px !important;
  margin: 0 !important;
  color: var(--push-ink) !important;
}

.push-audience-field > span {
  font-size: .86rem;
  font-weight: 900;
}

.push-audience-field select {
  width: 100%;
  min-height: 52px;
  height: 52px;
  margin: 0;
  padding: 0 46px 0 15px;
  border-radius: 16px;
  font-weight: 800 !important;
  color: var(--push-ink);
  background-color: #fff;
}

.push-audience-field small {
  color: var(--push-muted);
  font-size: .79rem;
  font-weight: 750;
  line-height: 1.4;
}

.walk-reminder-card,
.attachment-upload-box {
  padding: 18px;
}

.push-target-panel {
  position: sticky;
  top: 92px;
}

.push-target-panel .section-head {
  align-items: flex-start;
}

.push-preview-box {
  min-height: 132px;
}

.push-history-filters input,
.push-history-filters select {
  min-height: 44px;
  margin: 0;
}

@media (max-width: 1180px) {
  .push-layout {
    grid-template-columns: 1fr;
  }

  .push-target-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .push-channel-grid {
    grid-template-columns: 1fr;
  }

  .push-message-setup {
    padding: 16px;
    border-radius: 20px;
  }

  .push-channel-card {
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .push-block-heading {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
  }

  .push-step-number {
    width: 34px;
    height: 34px;
    border-radius: 12px;
  }

  .push-channel-card {
    grid-template-columns: 34px minmax(0, 1fr) 22px;
    gap: 10px;
    padding: 14px;
  }

  .push-channel-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
  }

  .push-channel-check {
    width: 22px;
    height: 22px;
  }
}

/* UltraMsg safe bulk WhatsApp — additive only. */
.whatsapp-channel-card .push-channel-copy {
  min-width: 0;
}

.whatsapp-test-btn {
  width: max-content;
  margin-top: 10px;
  min-height: 34px;
  position: relative;
  z-index: 2;
}

.whatsapp-safety-card {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 18px;
  border: 1px solid rgba(15,127,85,.2);
  border-radius: 22px;
  background: linear-gradient(135deg, #ecfdf3 0%, #ffffff 68%);
  box-shadow: 0 14px 34px rgba(15,127,85,.07);
}

.whatsapp-safety-card[hidden] {
  display: none !important;
}

.whatsapp-safety-card h3 {
  margin: 2px 0 6px;
}

.whatsapp-safety-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.whatsapp-safety-grid > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 16px;
  background: rgba(255,255,255,.92);
}

.whatsapp-safety-grid span {
  color: #64748b;
  font-size: .75rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.whatsapp-safety-grid strong {
  color: #0f172a;
  font-size: .92rem;
  line-height: 1.3;
}

.whatsapp-consent-check {
  display: flex !important;
  align-items: flex-start !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 13px 14px;
  border: 1px solid rgba(15,127,85,.18);
  border-radius: 16px;
  background: #fff;
  color: #0f172a;
  font-weight: 850;
  line-height: 1.4;
}

.whatsapp-consent-check input {
  width: 19px;
  height: 19px;
  margin-top: 1px;
  accent-color: #0f7f55;
  flex: 0 0 auto;
}

.preview-whatsapp-safety {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,.09);
  background: #f8fafc;
}

.preview-whatsapp-safety.is-ready {
  border-color: rgba(15,127,85,.2);
  background: #ecfdf3;
}

.preview-whatsapp-safety.is-warning {
  border-color: rgba(217,119,6,.2);
  background: #fffbeb;
}

.preview-whatsapp-safety strong,
.preview-whatsapp-safety span {
  display: block;
}

.preview-whatsapp-safety span {
  color: #64748b;
  font-size: .82rem;
  font-weight: 750;
}

@media (max-width: 980px) {
  .whatsapp-safety-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .whatsapp-safety-grid {
    grid-template-columns: 1fr;
  }

  .whatsapp-test-btn {
    width: 100%;
  }
}

/* Manageable Push Notification Presets */
.push-preset-picker-card .section-head{align-items:flex-start}.push-preset-picker-card label small{display:block;margin-top:5px;color:#64748b}
.push-preset-variable-tools{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px;border:1px solid rgba(37,99,235,.15);border-radius:18px;background:#f7faff}.push-preset-variable-tools>div:first-child{display:grid;gap:3px}.push-preset-variable-tools small{color:#64748b}
.push-preset-variable-chips{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:7px}.push-preset-variable-chips button{border:1px solid rgba(37,99,235,.24);border-radius:999px;padding:7px 10px;background:#fff;color:#1d4ed8;font-weight:900;cursor:pointer}.push-preset-variable-chips button:hover,.push-preset-variable-chips button:focus-visible{background:#2563eb;color:#fff;outline:none}
@media(max-width:720px){.push-preset-variable-tools{display:grid}.push-preset-variable-chips{justify-content:flex-start}}
