:root {
  --bg: #edf2ff;
  --surface: #ffffff;
  --surface-soft: #f7f9ff;
  --text: #11203b;
  --muted: #65748c;
  --brand: #6e1fb4;
  --brand-deep: #1e4585;
  --brand-soft: linear-gradient(135deg, #1b315f, #2850a3 65%, #334bb1);
  --line: #dbe4ff;
  --success: #169b62;
  --danger: #d64545;
  --info: #2d6cdf;
  --shadow: 0 18px 60px rgba(36, 58, 118, 0.14);
  --radius: 24px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(110, 31, 180, 0.24), transparent 28%),
    linear-gradient(180deg, #f7f7fb 0%, var(--bg) 100%);
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: 'Space Grotesk', sans-serif; margin: 0 0 12px; }
p { margin: 0 0 12px; color: var(--muted); }
small { color: var(--muted); }
input, select, textarea, button {
  font: inherit;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
}
textarea { resize: vertical; }
label { display: grid; gap: 8px; color: var(--text); font-weight: 600; }
.checkbox { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.checkbox input { width: auto; }

.topbar, .app-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.topbar {
  padding: 18px 28px;
  background: linear-gradient(90deg, #6620ab, #8c2cc2);
  color: #fff;
}
.brandmark, .sidebar-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
}
.topnav { display: flex; gap: 16px; flex-wrap: wrap; }
.topnav a { opacity: 0.92; }

.public-shell { max-width: 1180px; margin: 0 auto; padding: 36px 24px 60px; }
.page-hero { display: grid; gap: 20px; }
.page-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e9f1ff;
  padding: 10px 16px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.page-hero > h1 { font-size: clamp(2.2rem, 5vw, 4rem); max-width: 14ch; }
.hero-copy { max-width: 70ch; font-size: 1.05rem; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(135deg, #6e1fb4, #2c5be2);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn-ghost, .btn-light {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(214, 69, 69, 0.3);
}

.card, .messaging-hero {
  background: var(--surface);
  border: 1px solid rgba(170, 190, 255, 0.25);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card {
  padding: 22px;
}
.card-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.card-grid--stats .card {
  min-height: 160px;
}
.pricing-grid {
  display: grid;
  gap: 20px;
  margin-top: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.pricing-price { font-size: 2rem; font-weight: 700; margin: 10px 0; }

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: #212437;
  color: #eef2ff;
  padding: 24px 16px;
}
.sidebar-company { opacity: 0.75; margin: 8px 0 20px; }
.sidebar-nav {
  display: grid;
  gap: 8px;
}
.sidebar-nav a {
  padding: 12px 14px;
  border-radius: 16px;
  color: #d7def7;
}
.sidebar-nav a.is-active,
.sidebar-nav a:hover {
  background: rgba(121, 83, 216, 0.22);
  color: #fff;
}

.app-main { padding: 28px; }
.app-topbar { margin-bottom: 24px; }
.app-topbar__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.app-topbar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.messaging-hero {
  background: var(--brand-soft);
  color: #fff;
  padding: 28px;
  display: grid;
  gap: 20px;
  grid-template-columns: 1.6fr 0.9fr;
}
.messaging-hero p { color: rgba(255,255,255,0.85); }
.messaging-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}
.messaging-hero__chips span {
  background: rgba(255,255,255,0.12);
  padding: 10px 14px;
  border-radius: 999px;
}
.messaging-hero__panel {
  display: grid;
  gap: 14px;
  background: rgba(255,255,255,0.08);
  padding: 20px;
  border-radius: 24px;
}
.metric-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(0,0,0,0.14);
}
.metric-card small, .metric-card span { display: block; color: rgba(255,255,255,0.72); }
.metric-card strong { display: block; font-size: 2.2rem; margin: 8px 0; }

.stat-card .label { color: var(--muted); text-transform: uppercase; font-size: 0.82rem; letter-spacing: 0.08em; }
.stat-card .value { font-size: 2rem; font-weight: 700; margin-top: 10px; }
.stat-card .sub { color: var(--muted); margin-top: 8px; }

.split-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.split-grid--campaigns {
  align-items: start;
}
.section-head, .toolbar-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.inline-filters { display: flex; gap: 14px; flex-wrap: wrap; }
.search-input { margin: 16px 0; }

.table-wrap { overflow: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
thead th {
  color: #30519d;
  background: #edf3ff;
  font-family: 'Space Grotesk', sans-serif;
}
.audience-table-wrap { max-height: 420px; }
.form-stack {
  display: grid;
  gap: 14px;
}
.compact-form { margin-top: 20px; }

.saved-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-radius: 20px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  margin-bottom: 12px;
}
.saved-card--superadmin { align-items: stretch; flex-direction: column; }
.card-actions, .inline-admin-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.stack-grid { display: grid; gap: 20px; }

.badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}
.badge.success { background: rgba(22, 155, 98, 0.14); color: var(--success); }
.badge.info { background: rgba(45, 108, 223, 0.14); color: var(--info); }
.badge.danger { background: rgba(214, 69, 69, 0.14); color: var(--danger); }
.badge.muted { background: rgba(99, 115, 138, 0.14); color: var(--muted); }

.alert {
  padding: 14px 18px;
  border-radius: 16px;
  margin-bottom: 18px;
}
.alert.success { background: rgba(22, 155, 98, 0.12); color: #0f6d45; }
.alert.error { background: rgba(214, 69, 69, 0.12); color: #a62b2b; }

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { padding-bottom: 10px; }
  .messaging-hero, .split-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .app-main, .public-shell { padding: 18px; }
  .topbar, .app-topbar { flex-direction: column; align-items: flex-start; }
}

.btn-dark {
  background: #182033;
  color: #fff;
  border: 1px solid #182033;
}

.btn-sm {
  padding: 9px 14px;
  font-size: 0.88rem;
}

.hero-settings-btn {
  width: 100%;
}

.campaign-layout {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  align-items: start;
  margin-top: 22px;
}

.messaging-card {
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(170, 190, 255, 0.32);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.audience-card,
.composer-card,
.scheduler-card-block,
.logs-card-block {
  backdrop-filter: blur(10px);
}

.composer-card {
  position: sticky;
  top: 24px;
}

.section-head h3 {
  margin-bottom: 6px;
  font-size: 1.5rem;
}

.section-head p {
  margin-bottom: 0;
}

.search-shell {
  margin: 18px 0 14px;
}

.search-input {
  background: #fff;
  border-radius: 18px;
  padding: 14px 16px;
}

.audience-toolbar {
  margin-bottom: 14px;
}

.toolbar-inline__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.audience-toolbar__group {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 600;
}

.audience-toolbar__group select {
  width: 190px;
}

.selection-count {
  color: var(--muted);
  font-weight: 600;
}

.selection-count strong {
  color: var(--text);
}

.messaging-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.messaging-table tbody tr:hover {
  background: rgba(237, 243, 255, 0.72);
}

.customer-cell,
.contact-cell {
  display: grid;
  gap: 3px;
}

.customer-cell strong,
.contact-cell span {
  color: var(--text);
}

.status-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.empty-state {
  display: grid;
  gap: 6px;
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
}

.empty-state--soft {
  background: var(--surface-soft);
  border: 1px dashed var(--line);
  border-radius: 20px;
}

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

.saved-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fafcff;
  overflow: hidden;
}

.saved-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}

.saved-panel__body {
  display: grid;
  gap: 12px;
  padding: 14px;
  max-height: 238px;
  overflow: auto;
}

.saved-panel__empty {
  margin: 0;
  color: var(--muted);
}

.saved-item {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #ebf0ff;
}

.saved-item--group {
  border-left: 4px solid #7c3aed;
}

.saved-item__copy {
  display: grid;
  gap: 3px;
}

.saved-item__copy strong {
  color: var(--text);
}

.saved-item__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.provider-banner {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #eff6ff;
}

.provider-banner.is-ready {
  background: #eaf8ef;
  border-color: #a8e0bc;
}

.provider-banner.is-warning {
  background: #fff7e7;
  border-color: #f1d8a0;
}

.manual-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 6px;
}

.manual-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: #edf3ff;
  color: #30519d;
  font-size: 0.82rem;
  font-weight: 600;
}

.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag-btn {
  border: 1px solid #bfd2ff;
  background: #f5f8ff;
  color: #2d5dcb;
  padding: 7px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
}

.message-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.92rem;
}

.preview-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  overflow: hidden;
}

.preview-card__head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.preview-card__body {
  min-height: 88px;
  padding: 16px;
  color: var(--text);
  white-space: pre-wrap;
}

.save-row {
  display: flex;
  gap: 14px;
  align-items: end;
}

.save-row__fields {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: 1;
}

.save-campaign-btn {
  min-width: 160px;
}

.schedule-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  background: #fbfcff;
  border: 1px solid var(--line);
}

.schedule-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.composer-submit {
  display: grid;
  gap: 10px;
}

.composer-send-btn {
  width: 100%;
  min-height: 48px;
}

.composer-submit p {
  margin: 0;
  text-align: center;
}

.scheduler-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

.scheduler-item {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, #fbfdff, #f3f8ff);
  border: 1px solid var(--line);
}

.scheduler-item p {
  margin: 0;
}

.scheduler-item__head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.scheduler-item__head small {
  display: block;
  margin-top: 4px;
}

.scheduler-item__meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}

.scheduler-item__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

.log-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid var(--line);
}

.log-card p {
  margin: 0;
}

.log-card__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.log-card__head span {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.log-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  flex-wrap: wrap;
}

@media (max-width: 1280px) {
  .campaign-layout,
  .scheduler-grid,
  .log-grid {
    grid-template-columns: 1fr;
  }

  .composer-card {
    position: static;
  }
}

@media (max-width: 920px) {
  .mini-grid,
  .save-row,
  .save-row__fields,
  .schedule-grid {
    grid-template-columns: 1fr;
  }

  .save-row {
    display: grid;
  }

  .audience-toolbar__group {
    width: 100%;
  }

  .audience-toolbar__group select {
    width: 100%;
  }
}

.container-fluid {
  width: 100%;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-left: -12px;
  margin-right: -12px;
}

.row > [class*="col-"] {
  padding-left: 12px;
  padding-right: 12px;
}

.g-4 {
  row-gap: 24px;
}

.g-3 {
  row-gap: 18px;
}

.col-12 {
  width: 100%;
}

.d-flex {
  display: flex;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-2 {
  gap: 8px;
}

.align-items-end {
  align-items: end;
}

.w-100 {
  width: 100%;
}

.mt-1 {
  margin-top: 4px;
}

.mb-0 {
  margin-bottom: 0;
}

@media (min-width: 768px) {
  .col-md-3 { width: 25%; }
  .col-md-4 { width: 33.3333%; }
  .col-md-5 { width: 41.6667%; }
  .col-md-6 { width: 50%; }
}

@media (min-width: 1200px) {
  .col-xl-3 { width: 25%; }
  .col-xl-5 { width: 41.6667%; }
  .col-xl-7 { width: 58.3333%; }
}

.form-control,
.form-select {
  width: 100%;
  border: 1px solid #d6def5;
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  color: #0f172a;
}

.form-select-sm {
  padding: 10px 12px;
}

.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-danger,
.btn-outline-dark {
  background: #fff;
  box-shadow: none;
}

.btn-outline-secondary {
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.btn-outline-primary {
  color: #2563eb;
  border: 1px solid #93c5fd;
}

.btn-outline-danger {
  color: #ef4444;
  border: 1px solid #fda4af;
}

.btn-outline-dark {
  color: #111827;
  border: 1px solid #cbd5e1;
}

.badge-soft-success {
  background: #dcfce7;
  color: #15803d;
}

.badge-soft-secondary {
  background: #e2e8f0;
  color: #475569;
}

.badge-soft-info {
  background: #dbeafe;
  color: #2563eb;
}

.badge-soft-danger {
  background: #fee2e2;
  color: #dc2626;
}

.badge-soft-warning {
  background: #fef3c7;
  color: #b45309;
}

.messaging-page {
  padding: 24px 0 8px;
}

.messaging-summary {
  margin-bottom: 4px;
}

.messaging-card__head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.messaging-card__head h2 {
  margin: 0 0 6px;
  font-size: 1.55rem;
}

.messaging-card__head p {
  margin: 0;
}

.messaging-card__body {
  display: grid;
  gap: 16px;
}

.messaging-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.messaging-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f8fbff;
  border: 1px solid #e2e8f0;
}

.messaging-toggle input {
  width: auto;
}

.messaging-searchbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #dbe4ff;
}

.messaging-searchbar i {
  color: #94a3b8;
}

.messaging-searchbar input {
  border: 0;
  background: transparent;
  padding: 15px 0;
  margin: 0;
}

.messaging-searchbar input:focus {
  outline: none;
}

.messaging-actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.messaging-inline-filter {
  display: flex;
  align-items: center;
  gap: 10px;
}

.messaging-inline-filter label {
  display: block;
  font-weight: 700;
  color: #475569;
}

.messaging-inline-filter .form-select {
  min-width: 180px;
}

.messaging-selection-state {
  color: #64748b;
  font-weight: 600;
}

.messaging-table-wrap {
  max-height: 500px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
}

.messaging-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.messaging-table thead th {
  background: #eaf2ff;
  color: #30519d;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.messaging-table tbody td {
  background: #fff;
}

.messaging-person,
.messaging-contact {
  display: grid;
  gap: 4px;
}

.messaging-person strong,
.messaging-contact span {
  color: #0f172a;
}

.messaging-person span,
.messaging-contact small {
  color: #64748b;
}

.messaging-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.messaging-status {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid transparent;
}

.messaging-status i {
  margin-top: 3px;
}

.messaging-status strong,
.messaging-status span {
  display: block;
}

.messaging-status span {
  margin-top: 4px;
}

.messaging-status.is-ready {
  background: #eaf8ef;
  border-color: #a8e0bc;
  color: #166534;
}

.messaging-status.is-warning {
  background: #fff7e7;
  border-color: #f1d8a0;
  color: #92400e;
}

.messaging-label {
  display: block;
  margin-bottom: 8px;
  color: #334155;
  font-weight: 700;
}

.messaging-textarea {
  min-height: 140px;
  border-radius: 18px;
}

.messaging-textarea--compact {
  min-height: 96px;
}

.manual-phones-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.messaging-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.messaging-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: #64748b;
}

.messaging-preview {
  border: 1px solid #dbe4ff;
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}

.messaging-preview__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid #dbe4ff;
}

.messaging-preview__top span {
  color: #0f172a;
  font-weight: 700;
}

.messaging-preview__top small {
  color: #64748b;
}

.messaging-preview #messagePreview {
  min-height: 90px;
  padding: 16px;
  white-space: pre-wrap;
}

.messaging-submit {
  display: grid;
  gap: 10px;
}

.messaging-saved-block {
  padding: 0;
}

.messaging-saved-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.messaging-mini-card {
  background: #f8fbff;
  border: 1px solid #dbe4ff;
  border-radius: 20px;
  overflow: hidden;
}

.messaging-mini-card__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #dbe4ff;
}

.messaging-mini-card__head strong {
  color: #0f172a;
}

.messaging-mini-card__head span {
  color: #475569;
  font-weight: 700;
}

.messaging-mini-card__body {
  padding: 14px;
}

.messaging-mini-empty {
  margin: 0;
  color: #64748b;
}

.messaging-pill-list,
.messaging-template-list {
  display: grid;
  gap: 12px;
}

.saved-group-btn,
.saved-template-btn {
  display: grid;
  gap: 4px;
  width: 100%;
  text-align: left;
  padding: 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #e5e7eb;
  cursor: pointer;
}

.saved-group-btn {
  border-left: 4px solid var(--group-color, #1d4ed8);
}

.saved-group-btn span,
.saved-template-btn strong,
.saved-template-btn span,
.saved-template-btn small {
  display: block;
}

.saved-group-btn span,
.saved-template-btn strong {
  color: #0f172a;
  font-weight: 700;
}

.saved-group-btn small,
.saved-template-btn span,
.saved-template-btn small {
  color: #64748b;
}

.saved-template-actions {
  display: flex;
  gap: 8px;
  margin-top: -4px;
  flex-wrap: wrap;
}

.saved-template-actions .btn {
  flex: 1;
}

.messaging-save-template {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  background: #fbfcff;
  border: 1px solid #dbe4ff;
}

.messaging-schedule-panel {
  display: grid;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.messaging-primary-btn {
  width: 100%;
  min-height: 48px;
  background: linear-gradient(90deg, #1b7f8f, #2563eb);
  color: #fff;
  border: 0;
}

.messaging-primary-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.messaging-helper {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
}

.messaging-card--sticky {
  position: sticky;
  top: 24px;
}

.messaging-log-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.messaging-log-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #dbe4ff;
}

.messaging-log-card__head,
.messaging-log-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.messaging-log-card__head strong,
.messaging-log-card__head span {
  display: block;
}

.messaging-log-card__head span,
.messaging-log-card p,
.messaging-log-card__meta {
  color: #64748b;
}

.messaging-log-card p {
  margin: 0;
}

.messaging-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 28px 18px;
  text-align: center;
  color: #64748b;
}

.messaging-empty i {
  font-size: 1.4rem;
}

.messaging-empty strong {
  color: #0f172a;
}

.messaging-empty--soft {
  background: #f8fbff;
  border: 1px dashed #cbd5e1;
  border-radius: 20px;
}

.messaging-scheduler-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.scheduler-stat {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  border: 1px solid transparent;
}

.scheduler-stat--live {
  background: #dcfce7;
  color: #14532d;
  border-color: #86efac;
}

.scheduler-stat--soft {
  background: #dbeafe;
  color: #1e3a8a;
  border-color: #93c5fd;
}

.messaging-scheduler-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.scheduler-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, #fbfdff, #f3f8ff);
  border: 1px solid #dbe4ff;
}

.scheduler-card__head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.scheduler-card__head h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.scheduler-card__head p {
  margin: 0;
}

.scheduler-card__body p {
  margin: 0;
}

.scheduler-card__meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: #64748b;
  font-size: 0.9rem;
}

.scheduler-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.scheduler-card__actions .btn {
  min-width: 120px;
}

.messaging-summary-card,
.messaging-card {
  background: rgba(255,255,255,0.95);
}

.messaging-summary-card {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid rgba(170, 190, 255, 0.25);
  box-shadow: var(--shadow);
  min-height: 122px;
}

.messaging-summary-card .icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 56px;
}

.messaging-summary-card .icon i {
  font-size: 1.3rem;
}

.messaging-summary-card .label {
  color: #64748b;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.messaging-summary-card .value {
  font-size: 1.9rem;
  font-weight: 800;
  color: #0f172a;
}

.messaging-summary-card .sub {
  color: #64748b;
  font-size: 0.92rem;
}

.messaging-summary-card--blue { background: #eff6ff; }
.messaging-summary-card--blue .icon { background: #bfdbfe; color: #1d4ed8; }
.messaging-summary-card--mint { background: #ecfeff; }
.messaging-summary-card--mint .icon { background: #a5f3fc; color: #0f766e; }
.messaging-summary-card--amber { background: #fff7ed; }
.messaging-summary-card--amber .icon { background: #fed7aa; color: #c2410c; }
.messaging-summary-card--rose { background: #fff1f2; }
.messaging-summary-card--rose .icon { background: #fecdd3; color: #be123c; }

@media (max-width: 1199px) {
  .messaging-card--sticky {
    position: static;
  }
}

@media (max-width: 991px) {
  .messaging-saved-grid,
  .messaging-scheduler-grid,
  .messaging-log-grid {
    grid-template-columns: 1fr;
  }
}
