/* ══════════════════════════════════════════════════════════════
   Webinar SMS Analytics — All styles scoped to #conv-analytics-panel
   ══════════════════════════════════════════════════════════════ */

/* ── Panel Container ────────────────────────────────────────── */

#conv-analytics-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  background: var(--bg);
  min-height: 0;
}

/* Inner scroll container — wraps everything except the drilldown */
.wa-scroll-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  scroll-behavior: smooth;
}

.wa-scroll-content::-webkit-scrollbar {
  width: 5px;
}

.wa-scroll-content::-webkit-scrollbar-track {
  background: transparent;
}

.wa-scroll-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* ── Header ─────────────────────────────────────────────────── */

.wa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.wa-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wa-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.wa-subtitle {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 400;
}

.wa-refresh-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.12s, color 0.12s;
}

.wa-refresh-btn:hover {
  background: var(--hover);
  color: var(--text);
}

.wa-refresh-btn.spinning svg {
  animation: wa-spin 0.8s linear infinite;
}

@keyframes wa-spin {
  to { transform: rotate(360deg); }
}

/* ── Hero Row (4 KPI Cards) ─────────────────────────────────── */

.wa-hero-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 16px 20px 0;
  flex-shrink: 0;
}

/* ── Section Label ──────────────────────────────────────────── */

.wa-section-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 18px 20px 10px;
  flex-shrink: 0;
}

/* ── Pipeline Scroll Area ───────────────────────────────────── */

.wa-pipeline-scroll {
  flex-shrink: 0;
  overflow-x: auto;
  padding: 0 20px 20px;
}

.wa-pipeline-scroll::-webkit-scrollbar {
  height: 4px;
}

.wa-pipeline-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.wa-pipeline-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.wa-pipeline-groups {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  width: max-content;
  gap: 0;
}

.wa-pipeline-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.wa-pipeline-row {
  display: flex;
  align-items: center;
  width: max-content;
  gap: 0;
  padding-bottom: 2px;
}

/* ── Step Card ──────────────────────────────────────────────── */

.wa-step-card {
  width: 156px;
  min-width: 156px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 14px 14px 12px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  position: relative;
}

.wa-step-card:hover {
  border-color: var(--text-light);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.wa-step-card.active {
  border-color: var(--text);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.10);
}

[data-theme="dark"] .wa-step-card.active {
  border-color: rgba(255, 255, 255, 0.55);
}

.wa-step-num {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 5px;
}

.wa-step-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 10px;
  min-height: 32px;
}

.wa-step-sent {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.025em;
  line-height: 1;
  margin-bottom: 2px;
}

.wa-step-sent-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 9px;
  font-weight: 400;
}

/* ── Delivery Rate Pill ─────────────────────────────────────── */

.wa-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.wa-step-pill--green {
  background: var(--green-bg);
  color: var(--green);
}

.wa-step-pill--amber {
  background: var(--amber-bg);
  color: var(--amber);
}

.wa-step-pill--red {
  background: var(--red-bg);
  color: var(--red);
}

.wa-step-pill--empty {
  background: var(--tag-bg);
  color: var(--text-muted);
}

/* ── Connector Arrow Between Step Cards ─────────────────────── */

.wa-step-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  flex-shrink: 0;
  color: var(--border);
}

/* ── Group Connector (between Opt-in and Webinar Day groups) ─── */

.wa-group-connector {
  display: flex;
  align-items: center;
  padding: 0 2px;
  color: var(--border);
  margin-top: 52px;
  flex-shrink: 0;
}

/* ── Shimmer (Loading Skeleton) ─────────────────────────────── */

.wa-step-card.shimmer .wa-step-sent,
.wa-step-card.shimmer .wa-step-sent-label,
.wa-step-card.shimmer .wa-step-label,
.wa-step-card.shimmer .wa-step-num,
.wa-step-card.shimmer .wa-step-pill,
.wa-step-card.shimmer .wa-step-pending,
.wa-step-card.shimmer .wa-step-pending-label,
.wa-step-card.shimmer .wa-step-delivered-label,
.wa-step-card.shimmer .wa-step-scheduled {
  background: var(--border) !important;
  color: transparent !important;
  border-radius: 4px;
  animation: conv-pulse 1.4s ease-in-out infinite;
  pointer-events: none;
}

.wa-hero-row .kpi-card.shimmer .kpi-value,
.wa-hero-row .kpi-card.shimmer .kpi-label {
  background: var(--border) !important;
  color: transparent !important;
  border-radius: 4px;
  animation: conv-pulse 1.4s ease-in-out infinite;
}

/* ── Error State ────────────────────────────────────────────── */

.wa-pipeline-error {
  padding: 20px;
  font-size: 12px;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Drilldown Panel ────────────────────────────────────────── */

.wa-drilldown {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  background: var(--bg);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 20;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.07);
}

.wa-drilldown.open {
  transform: translateX(0);
}

[data-theme="dark"] .wa-drilldown {
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.35);
}

/* ── Drilldown Header ───────────────────────────────────────── */

.wa-drilldown-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.wa-drilldown-header-text {
  flex: 1;
  min-width: 0;
}

.wa-drilldown-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-drilldown-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.wa-dd-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.wa-dd-meta-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wa-dd-meta-dot--green   { background: var(--green); }
.wa-dd-meta-dot--red     { background: var(--red); }
.wa-dd-meta-dot--neutral { background: var(--text-muted); }

.wa-drilldown-close {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
  font-family: inherit;
}

.wa-drilldown-close:hover {
  background: var(--hover);
  color: var(--text);
}

/* ── Message Preview Strip ──────────────────────────────────── */

.wa-drilldown-msg-preview-wrap {
  margin: 12px 16px 0;
  position: relative;
  flex-shrink: 0;
}

.wa-drilldown-msg-preview {
  padding: 10px 34px 10px 12px;
  background: var(--tag-bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-style: italic;
}

.wa-dd-preview-edit-btn {
  position: absolute;
  top: 7px;
  right: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 3px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
}

.wa-dd-preview-edit-btn:hover {
  background: var(--hover);
  color: var(--text);
}

.wa-dd-preview-saved-msg {
  position: absolute;
  bottom: -18px;
  left: 0;
  font-size: 10.5px;
  color: var(--green);
  font-weight: 600;
}

.wa-dd-preview-edit-mode {
  margin: 12px 16px 0;
  flex-shrink: 0;
}

.wa-dd-preview-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  font-size: 11.5px;
  line-height: 1.5;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
}

.wa-dd-preview-textarea:focus {
  outline: none;
  border-color: var(--text-light);
}

.wa-dd-preview-edit-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.wa-dd-preview-save-btn {
  font-size: 11px;
  padding: 4px 12px;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: opacity 0.12s;
}

.wa-dd-preview-save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wa-dd-preview-cancel-btn {
  font-size: 11px;
  padding: 4px 10px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s;
}

.wa-dd-preview-cancel-btn:hover {
  background: var(--hover);
}

/* ── Filter Tabs ────────────────────────────────────────────── */

.wa-drilldown-filter-tabs {
  display: flex;
  gap: 5px;
  padding: 12px 16px 10px;
  flex-shrink: 0;
}

.wa-dd-tab {
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.wa-dd-tab:hover {
  background: var(--hover);
  color: var(--text);
}

.wa-dd-tab.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* ── Drilldown Count Badge ──────────────────────────────────── */

.wa-dd-count {
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 16px 8px;
  flex-shrink: 0;
}

/* ── Drilldown Table ────────────────────────────────────────── */

.wa-drilldown-table-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 16px;
}

.wa-drilldown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.wa-drilldown-table thead th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 6px 8px 6px 0;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--bg);
}

.wa-drilldown-table tbody td {
  padding: 9px 8px 9px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.wa-drilldown-table tbody tr:last-child td {
  border-bottom: none;
}

.wa-drilldown-table tbody tr:hover td {
  background: var(--hover);
}

.wa-dd-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.wa-dd-phone {
  color: var(--text-muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.wa-dd-time {
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
}

/* ── Status Pill (in table) ─────────────────────────────────── */

.wa-dd-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.wa-dd-status-pill--delivered  { background: var(--green-bg); color: var(--green); }
.wa-dd-status-pill--failed     { background: var(--red-bg);   color: var(--red);   }
.wa-dd-status-pill--sent       { background: var(--blue-bg);  color: var(--blue);  }
.wa-dd-status-pill--queued     { background: var(--tag-bg);   color: var(--text-muted); }
.wa-dd-status-pill--unknown    { background: var(--tag-bg);   color: var(--text-muted); }

/* ── Empty / No-data State ──────────────────────────────────── */

.wa-dd-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 32px 0;
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 960px) {
  .wa-hero-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .wa-drilldown {
    width: 100%;
  }

  .wa-hero-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Workflow Group Headers ──────────────────────────────────── */

.wa-group-header {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px 6px 0 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.wa-group-header--blue {
  background: var(--blue-bg, rgba(59,130,246,0.08));
  color: var(--blue, #3b82f6);
  border: 1px solid rgba(59,130,246,0.2);
  border-bottom: none;
}

.wa-group-header--gray {
  background: var(--tag-bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-bottom: none;
}

.wa-group-header-label {
  flex-shrink: 0;
  font-weight: 700;
}

.wa-group-header-sep {
  opacity: 0.4;
  font-weight: 400;
}

.wa-group-header-date {
  font-weight: 500;
  font-size: 10px;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.9;
}

.wa-group-header-date-edit {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.45;
  padding: 2px;
  display: flex;
  align-items: center;
  border-radius: 3px;
  font-family: inherit;
  transition: opacity 0.12s;
  flex-shrink: 0;
}

.wa-group-header-date-edit:hover {
  opacity: 1;
}

/* ── Inline Date Picker ─────────────────────────────────────── */

.wa-date-picker-inline {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
}

.wa-date-input {
  font-size: 10px;
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}

.wa-date-save-btn {
  font-size: 10px;
  padding: 2px 8px;
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: opacity 0.12s;
}

.wa-date-save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wa-date-cancel-btn {
  font-size: 10px;
  padding: 2px 6px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
}

/* ── Pending Count on Step Cards ────────────────────────────── */

.wa-step-pending {
  font-size: 15px;
  font-weight: 700;
  color: var(--amber, #f59e0b);
  line-height: 1;
  margin-bottom: 1px;
}

.wa-step-pending-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 7px;
  font-weight: 400;
}

.wa-step-delivered-label {
  font-size: 10px;
  color: var(--green, #22c55e);
  margin-bottom: 7px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ── Inbox Button in Drilldown Table ────────────────────────── */

.wa-dd-inbox-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 5px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
}

.wa-dd-inbox-btn:hover {
  background: var(--hover);
  color: var(--blue, #3b82f6);
}

/* ── Scheduled Send Time on Webinar Day Cards ────────────────── */

.wa-step-scheduled {
  font-size: 9.5px;
  color: var(--text-muted);
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* ── Timezone Hint in Date Picker ───────────────────────────── */

.wa-date-tz-hint {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   ENTERPRISE UI UPGRADES — Analytics Tab Only
   ══════════════════════════════════════════════════════════════ */

/* ── Elevated Section Labels ──────────────────────────────────── */

#conv-analytics-panel .wa-section-label {
  position: relative;
  padding-left: 14px;
}

#conv-analytics-panel .wa-section-label::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 14px;
  background: var(--blue);
  border-radius: 2px;
}

/* ── KPI Card Hover Lift ──────────────────────────────────────── */

.wa-hero-row .kpi-card {
  border-radius: 8px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.2s, border-color 0.2s;
}

.wa-hero-row .kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .wa-hero-row .kpi-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

/* ── Step Card Refined Hover ──────────────────────────────────── */

.wa-step-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .wa-step-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* ── Header Subtle Shadow ─────────────────────────────────────── */

.wa-header {
  box-shadow: 0 1px 0 var(--border);
}

/* ══════════════════════════════════════════════════════════════
   OPT-IN HISTORY — Full Section Styles
   ══════════════════════════════════════════════════════════════ */

/* ── Container ────────────────────────────────────────────────── */

.wa-optin-history {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  border-top: 1px solid var(--border);
}

/* ── Header ───────────────────────────────────────────────────── */

.wa-oh-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  flex-shrink: 0;
  gap: 12px;
  flex-wrap: wrap;
}

.wa-oh-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wa-oh-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  position: relative;
  padding-left: 14px;
}

.wa-oh-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 14px;
  background: var(--purple);
  border-radius: 2px;
}

.wa-oh-subtitle {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 400;
  padding-left: 14px;
}

/* ── Controls Row ─────────────────────────────────────────────── */

.wa-oh-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Date Range Inputs ────────────────────────────────────────── */

.wa-oh-date-range {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wa-oh-date-input {
  font-size: 11px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.15s;
  width: 130px;
}

.wa-oh-date-input:focus {
  outline: none;
  border-color: var(--text-light);
}

.wa-oh-date-input:hover {
  border-color: var(--text-light);
}

[data-theme="dark"] .wa-oh-date-input {
  color-scheme: dark;
}

.wa-oh-date-sep {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Source Filter Dropdown ────────────────────────────────────── */

.wa-oh-filter-wrap {
  position: relative;
}

.wa-oh-filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
}

.wa-oh-filter-btn:hover {
  border-color: var(--text-light);
  background: var(--hover);
}

.wa-oh-filter-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  z-index: 30;
}

[data-theme="dark"] .wa-oh-filter-dropdown {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.wa-oh-filter-dropdown.open {
  display: block;
}

.wa-oh-filter-dropdown-item {
  padding: 7px 10px;
  font-size: 12px;
  color: var(--text);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.1s;
  white-space: nowrap;
}

.wa-oh-filter-dropdown-item:hover {
  background: var(--hover);
}

.wa-oh-filter-dropdown-item.active {
  background: var(--selected);
  font-weight: 600;
}

/* ── Export Button ─────────────────────────────────────────────── */

.wa-oh-export-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--bg);
  background: var(--text);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.wa-oh-export-btn:hover {
  opacity: 0.85;
}

.wa-oh-export-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── KPI Strip ────────────────────────────────────────────────── */

.wa-oh-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 20px 14px;
  flex-shrink: 0;
}

.wa-oh-kpi {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s, background 0.15s;
  border-bottom: 2px solid var(--card-border);
  text-align: center;
}

.wa-oh-kpi:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .wa-oh-kpi:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.wa-oh-kpi.active {
  border-color: var(--text-light);
  background: var(--hover);
}

.wa-oh-kpi--blue   { border-bottom-color: var(--blue); }
.wa-oh-kpi--green  { border-bottom-color: var(--green); }
.wa-oh-kpi--red    { border-bottom-color: var(--red); }
.wa-oh-kpi--muted  { border-bottom-color: var(--text-light); }

.wa-oh-kpi-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 4px;
}

.wa-oh-kpi-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Table Wrapper ────────────────────────────────────────────── */

.wa-oh-table-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 20px;
  min-height: 0;
}

.wa-oh-table-wrap::-webkit-scrollbar {
  width: 5px;
}

.wa-oh-table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.wa-oh-table-wrap::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* ── Table ─────────────────────────────────────────────────────── */

.wa-oh-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.wa-oh-table thead th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}

.wa-oh-table thead th:first-child {
  padding-left: 12px;
}

.wa-oh-table tbody td {
  padding: 10px 10px 10px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.wa-oh-table tbody td:first-child {
  padding-left: 12px;
}

.wa-oh-table tbody tr:last-child td {
  border-bottom: none;
}

.wa-oh-table tbody tr {
  transition: background 0.1s;
}

.wa-oh-table tbody tr:hover td {
  background: var(--hover);
}

/* ── Row Failure Indicator ────────────────────────────────────── */

.wa-oh-table tbody tr.wa-oh-row-failed {
  border-left: 3px solid var(--red);
}

/* ── Cell Styles ──────────────────────────────────────────────── */

.wa-oh-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  color: var(--text);
  font-size: 12.5px;
}

.wa-oh-source-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  background: var(--tag-bg);
  color: var(--text-muted);
  white-space: nowrap;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-oh-date {
  color: var(--text-muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.wa-oh-next-exec {
  color: var(--text-muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.wa-oh-next-exec.wa-oh-overdue {
  color: var(--red);
  font-weight: 600;
}

/* ── Campaign Status Pills ────────────────────────────────────── */

.wa-oh-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.wa-oh-status-pill--campaign_complete {
  background: var(--green-bg);
  color: var(--green);
}

.wa-oh-status-pill--in_progress {
  background: var(--blue-bg);
  color: var(--blue);
}

.wa-oh-status-pill--stuck {
  background: var(--red-bg);
  color: var(--red);
}

.wa-oh-status-pill--no_active_campaign {
  background: var(--tag-bg);
  color: var(--text-muted);
}

/* Status dot indicator inside pill */
.wa-oh-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wa-oh-status-pill--campaign_complete .wa-oh-status-dot { background: var(--green); }
.wa-oh-status-pill--in_progress .wa-oh-status-dot { background: var(--blue); }
.wa-oh-status-pill--stuck .wa-oh-status-dot { background: var(--red); }
.wa-oh-status-pill--no_active_campaign .wa-oh-status-dot { background: var(--text-light); }

/* ── Inbox Button ─────────────────────────────────────────────── */

.wa-oh-inbox-btn {
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 500;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.wa-oh-inbox-btn:hover {
  background: var(--blue-bg);
  color: var(--blue);
  border-color: var(--blue);
}

/* ── Empty State ──────────────────────────────────────────────── */

.wa-oh-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
  padding: 48px 0;
}

.wa-oh-empty td {
  padding: 48px 0 !important;
}

.wa-oh-empty-icon {
  display: block;
  margin: 0 auto 10px;
  color: var(--text-light);
}

/* ── Shimmer State ────────────────────────────────────────────── */

.wa-oh-kpi.shimmer .wa-oh-kpi-value,
.wa-oh-kpi.shimmer .wa-oh-kpi-label {
  background: var(--border) !important;
  color: transparent !important;
  border-radius: 4px;
  animation: conv-pulse 1.4s ease-in-out infinite;
}

.wa-oh-shimmer-row td {
  padding: 12px 10px 12px 0;
}

.wa-oh-shimmer-row td:first-child {
  padding-left: 12px;
}

.wa-oh-shimmer-block {
  height: 14px;
  border-radius: 4px;
  background: var(--border);
  animation: conv-pulse 1.4s ease-in-out infinite;
}

.wa-oh-shimmer-block.w-name { width: 120px; }
.wa-oh-shimmer-block.w-source { width: 80px; }
.wa-oh-shimmer-block.w-date { width: 100px; }
.wa-oh-shimmer-block.w-status { width: 130px; }
.wa-oh-shimmer-block.w-exec { width: 90px; }
.wa-oh-shimmer-block.w-inbox { width: 28px; }

/* ── Responsive ───────────────────────────────────────────────── */

@media (max-width: 960px) {
  .wa-oh-kpi-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .wa-oh-controls {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .wa-oh-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .wa-oh-controls {
    flex-direction: column;
    width: 100%;
    gap: 6px;
  }
  .wa-oh-date-range {
    width: 100%;
  }
  .wa-oh-date-input {
    flex: 1;
  }
  .wa-oh-kpi-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}
