/**
 * WLF Systems Monitor - Dashboard Styles (Light Theme)
 * =====================================================
 * Matches the UptimeRobot status page aesthetic:
 * white card on light gray background, dark navy text,
 * green/amber/red status indicators.
 *
 * Design tokens:
 *   Background:   #f5f6fa  (page bg — matches WP site)
 *   Card:         #ffffff  (main white card)
 *   Inner:        #f8f9fc  (section backgrounds)
 *   Border:       #e8eaf0  (subtle borders)
 *   Text primary: #1e2a4a  (dark navy — matches header)
 *   Text muted:   #6b7a99  (secondary text)
 *   Text faint:   #9aa3bc  (labels, timestamps)
 *   Green:        #3bd671 (active/success)
 *   Amber:        #f59e0b  (silent/warning)
 *   Red:          #ef4444  (error/offline)
 *   Blue:         #3b82f6  (info/callrail)
 *   Purple:       #8b5cf6  (intaker)
 *   Cyan:         #06b6d4  (facebook)
 *   Orange:       #f59e0b  (partner)
 */

/* ============================================================
   RESET & BASE
   ============================================================ */
.wlf-dashboard * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.wlf-dashboard {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 14px;
  color: #1e2a4a;
  background: #ffffff;
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
}

/* ============================================================
   HEADER ROW
   ============================================================ */
.wlf-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 8px;
}

.wlf-header-title {
  font-size: 22px;
  font-weight: 700;
  color: #1e2a4a;
  letter-spacing: -0.02em;
}

.wlf-header-subtitle {
  font-size: 13px;
  color: #6b7a99;
  margin-top: 3px;
}

.wlf-header-meta {
  text-align: right;
  font-size: 13px;
  color: #6b7a99;
}

.wlf-last-updated {
  font-size: 11px;
  color: #9aa3bc;
  margin-top: 3px;
}

/* ============================================================
   STATUS BANNER
   ============================================================ */
.wlf-status-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border-radius: 10px;
  margin-bottom: 24px;
  font-weight: 600;
  font-size: 16px;
}

.wlf-status-banner.active {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

.wlf-status-banner.warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #b45309;
}

.wlf-status-banner.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.wlf-status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wlf-status-banner.active  .wlf-status-dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.2); }
.wlf-status-banner.warning .wlf-status-dot { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.2); }
.wlf-status-banner.error   .wlf-status-dot { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.2); }

/* ============================================================
   STAT BOXES
   ============================================================ */
.wlf-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.wlf-stat-box {
  background: #f8f9fc;
  border-radius: 10px;
  padding: 18px 16px;
  text-align: center;
  border: 1px solid #e8eaf0;
  transition: box-shadow 0.15s ease;
}

.wlf-stat-box:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.wlf-stat-number {
  font-size: 34px;
  font-weight: 800;
  color: #1e2a4a;
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.wlf-stat-number.green  { color: #3bd671; }
.wlf-stat-number.amber  { color: #d97706; }
.wlf-stat-number.red    { color: #dc2626; }
.wlf-stat-number.blue   { color: #2563eb; }
.wlf-stat-number.purple { color: #7c3aed; }

.wlf-stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9aa3bc;
}

.wlf-stat-delta {
  font-size: 11px;
  color: #9aa3bc;
  margin-top: 4px;
}

.wlf-stat-delta.up   { color: #16a34a; }
.wlf-stat-delta.down { color: #dc2626; }

/* ============================================================
   SECTION BLOCKS
   ============================================================ */
.wlf-section {
  background: #f8f9fc;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid #e8eaf0;
}

.wlf-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9aa3bc;
  margin-bottom: 16px;
}

/* ============================================================
   ZAP HEALTH TABLE
   ============================================================ */
.wlf-zap-table {
  width: 100%;
  border-collapse: collapse;
}

.wlf-zap-table th {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9aa3bc;
  padding: 0 10px 12px 10px;
  text-align: left;
  border-bottom: 1px solid #e8eaf0;
}

.wlf-zap-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #f0f1f5;
  color: #374151;
  font-size: 13px;
  vertical-align: middle;
}

.wlf-zap-table tr:last-child td {
  border-bottom: none;
}

.wlf-zap-table tr:hover td {
  background: #f8f9fc;
}

.wlf-zap-name {
  font-weight: 600;
  color: #1e2a4a;
}

.wlf-zap-system {
  font-size: 11px;
  color: #9aa3bc;
  margin-top: 2px;
  text-transform: capitalize;
}

/* ============================================================
   STATUS BADGES
   ============================================================ */
.wlf-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.wlf-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wlf-badge.active  { background: #dcfce7; color: #15803d; }
.wlf-badge.active::before  { background: #22c55e; }

.wlf-badge.silent  { background: #fef3c7; color: #b45309; }
.wlf-badge.silent::before  { background: #f59e0b; }

.wlf-badge.error   { background: #fee2e2; color: #b91c1c; }
.wlf-badge.error::before   { background: #ef4444; }

.wlf-badge.offline { background: #f1f5f9; color: #64748b; }
.wlf-badge.offline::before { background: #94a3b8; }

.wlf-badge.unknown { background: #f1f5f9; color: #64748b; }
.wlf-badge.unknown::before { background: #94a3b8; }

/* Hidden test zaps — only rendered in the Zapier page audit view */
.wlf-badge.hidden { background: #ede9fe; color: #6d28d9; }
.wlf-badge.hidden::before { background: #a78bfa; }

/* Per-zap health states (v1.9.0): quiet = between firings (NOT a warning),
   stalled = daily producer with nothing today (the only red),
   dormant = asleep ≥7 days (sorted last, excluded from KPI denominators) */
.wlf-badge.quiet   { background: #e0f2fe; color: #0369a1; }
.wlf-badge.quiet::before   { background: #38bdf8; }

.wlf-badge.stalled { background: #fee2e2; color: #b91c1c; }
.wlf-badge.stalled::before { background: #ef4444; }

.wlf-badge.dormant { background: #f8fafc; color: #94a3b8; }
.wlf-badge.dormant::before { background: #cbd5e1; }

/* ============================================================
   SYSTEM BREAKDOWN BARS
   ============================================================ */
.wlf-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wlf-breakdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wlf-breakdown-label {
  width: 110px;
  font-size: 12px;
  color: #6b7a99;
  flex-shrink: 0;
  text-transform: capitalize;
  font-weight: 500;
}

.wlf-breakdown-bar-wrap {
  flex: 1;
  background: #e8eaf0;
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}

.wlf-breakdown-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.wlf-breakdown-bar.callrail { background: #3b82f6; }
.wlf-breakdown-bar.intaker  { background: #8b5cf6; }
.wlf-breakdown-bar.facebook { background: #06b6d4; }
.wlf-breakdown-bar.partner  { background: #f59e0b; }
.wlf-breakdown-bar.other    { background: #94a3b8; }
.wlf-breakdown-bar.default  { background: #3b82f6; }

.wlf-breakdown-count {
  width: 32px;
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  color: #1e2a4a;
  flex-shrink: 0;
}

/* ============================================================
   FILTER CONTROLS
   ============================================================ */
.wlf-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.wlf-filter-label {
  font-size: 11px;
  color: #9aa3bc;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.wlf-select {
  background: #ffffff;
  border: 1px solid #e8eaf0;
  color: #1e2a4a;
  padding: 7px 32px 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239aa3bc' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.wlf-select:hover {
  border-color: #c7ccd8;
}

.wlf-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* ============================================================
   CHART CONTAINER
   ============================================================ */
.wlf-chart-wrap {
  position: relative;
  height: 200px;
  margin-top: 8px;
}

/* ============================================================
   TWO-COLUMN GRID
   ============================================================ */
.wlf-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* ============================================================
   LOADING & ERROR STATES
   ============================================================ */
.wlf-loading {
  text-align: center;
  padding: 40px;
  color: #9aa3bc;
  font-size: 13px;
}

.wlf-loading::before {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  border: 2px solid #e8eaf0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: wlf-spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes wlf-spin {
  to { transform: rotate(360deg); }
}

.wlf-error {
  text-align: center;
  padding: 24px;
  color: #b91c1c;
  font-size: 13px;
  background: #fef2f2;
  border-radius: 8px;
  border: 1px solid #fecaca;
}

/* ============================================================
   DIVIDER
   ============================================================ */
.wlf-divider {
  border: none;
  border-top: 1px solid #e8eaf0;
  margin: 16px 0;
}

/* ============================================================
   TREND INDICATOR
   ============================================================ */
.wlf-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
}
.wlf-trend.up   { color: #16a34a; }
.wlf-trend.down { color: #dc2626; }
.wlf-trend.flat { color: #9aa3bc; }

/* ============================================================
   HEALTH CARD (used on CallRail + Intaker pages)
   ============================================================ */
.wlf-health-card {
  background: #f8f9fc;
  border-radius: 10px;
  padding: 20px;
  border: 1px solid #e8eaf0;
  margin-bottom: 16px;
}

/* ============================================================
   RESPONSIVE — TABLET (max 768px)
   ============================================================ */
@media (max-width: 768px) {
  .wlf-dashboard {
    padding: 20px 16px;
    border-radius: 8px;
  }

  .wlf-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .wlf-two-col {
    grid-template-columns: 1fr;
  }

  .wlf-zap-table th:nth-child(4),
  .wlf-zap-table td:nth-child(4) {
    display: none;
  }

  .wlf-header {
    flex-direction: column;
  }

  .wlf-header-meta {
    text-align: left;
  }
}

/* ============================================================
   RESPONSIVE — MOBILE (max 480px)
   ============================================================ */
@media (max-width: 480px) {
  .wlf-dashboard {
    padding: 16px 12px;
  }

  .wlf-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .wlf-stat-number {
    font-size: 26px;
  }

  .wlf-stat-box {
    padding: 14px 10px;
  }

  /* Convert zap table to card layout on mobile */
  .wlf-zap-table thead {
    display: none;
  }

  .wlf-zap-table tr {
    display: block;
    background: #ffffff;
    border: 1px solid #e8eaf0;
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 12px 14px;
  }

  .wlf-zap-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: none;
    font-size: 12px;
  }

  .wlf-zap-table td::before {
    content: attr(data-label);
    font-size: 10px;
    color: #9aa3bc;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
  }

  .wlf-breakdown-label {
    width: 90px;
    font-size: 11px;
  }

  .wlf-chart-wrap {
    height: 160px;
  }

  .wlf-filters {
    flex-direction: column;
    align-items: flex-start;
  }

  .wlf-status-banner {
    font-size: 14px;
    padding: 14px 16px;
  }

  .wlf-uptime-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .wlf-system-cards {
    grid-template-columns: 1fr !important;
  }

  .wlf-zap-group-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* ============================================================
   UPTIME MONITOR GRID — Direction B redesign (2026)
   Path-first cards with 30-day status strip.
   ============================================================ */

/* Grid container (kept name `.wlf-uptime-grid` so existing JS still finds it) */
.wlf-uptime-grid {
  display: block;
  margin-bottom: 20px;
}

/* Header row: summary on the left, average-uptime stat on the right */
.wlf-uptime-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid #e8eaf0;
}
.wlf-uptime-summary-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #1e2a4a;
  font-weight: 500;
}
.wlf-uptime-summary-line strong {
  font-weight: 700;
  color: #1e2a4a;
}
.wlf-uptime-summary-line .wlf-uptime-summary-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.18);
  flex-shrink: 0;
}
.wlf-uptime-summary-line.warn .wlf-uptime-summary-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245,158,11,0.18);
}
.wlf-uptime-summary-line.bad .wlf-uptime-summary-dot {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.18);
}
.wlf-uptime-summary-warn { color: #b45309; }
.wlf-uptime-summary-bad  { color: #b91c1c; font-weight: 700; }

.wlf-uptime-avg {
  text-align: right;
  flex-shrink: 0;
}
.wlf-uptime-avg-value {
  font-size: 28px;
  font-weight: 800;
  color: #1e2a4a;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.wlf-uptime-avg-value .wlf-uptime-avg-pct {
  font-size: 18px;
  font-weight: 700;
  color: #9aa3bc;
  margin-left: 1px;
}
.wlf-uptime-avg-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9aa3bc;
  margin-top: 4px;
}

/* Card grid (sorted: down → degraded → operational) */
.wlf-uptime-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 10px;
}

/* Individual site card */
.wlf-uptime-card {
  display: block;
  padding: 12px 14px 10px;
  border-radius: 8px;
  border: 1px solid #e8eaf0;
  background: #ffffff;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.wlf-uptime-card:hover {
  box-shadow: 0 4px 14px rgba(13,28,64,0.06);
  border-color: #cdd3e0;
  transform: translateY(-1px);
}
.wlf-uptime-card[data-status="down"] {
  background: #fef2f2;
  border-color: #fecaca;
  box-shadow: 0 0 0 1px #fecaca inset;
}
.wlf-uptime-card[data-status="seems_down"] {
  border-color: #fed7aa;
}

.wlf-uptime-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.wlf-uptime-card-id {
  min-width: 0;
  flex: 1;
}
.wlf-uptime-card-host {
  font-size: 10px;
  font-weight: 600;
  color: #9aa3bc;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wlf-uptime-card-path {
  font-size: 14px;
  font-weight: 700;
  color: #1e2a4a;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wlf-uptime-card-path .wlf-uptime-card-home {
  color: #9aa3bc;
  font-style: normal;
}
.wlf-uptime-card[data-status="down"] .wlf-uptime-card-path {
  color: #b91c1c;
}
.wlf-uptime-card-right {
  text-align: right;
  flex-shrink: 0;
}
.wlf-uptime-card-pct {
  font-size: 18px;
  font-weight: 800;
  color: #1e2a4a;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.wlf-uptime-card-pct .wlf-uptime-card-pct-sign {
  font-size: 12px;
  font-weight: 700;
  color: #9aa3bc;
  margin-left: 1px;
}
.wlf-uptime-card[data-status="down"] .wlf-uptime-card-pct { color: #b91c1c; }
.wlf-uptime-card-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px 2px 6px;
  border-radius: 10px;
  margin-top: 6px;
  letter-spacing: 0.02em;
  background: #dcfce7;
  color: #15803d;
}
.wlf-uptime-card-pill .wlf-uptime-pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #22c55e;
}
.wlf-uptime-card[data-status="seems_down"] .wlf-uptime-card-pill {
  background: #fef3c7;
  color: #b45309;
}
.wlf-uptime-card[data-status="seems_down"] .wlf-uptime-pill-dot { background: #f59e0b; }
.wlf-uptime-card[data-status="down"] .wlf-uptime-card-pill {
  background: #fee2e2;
  color: #b91c1c;
}
.wlf-uptime-card[data-status="down"] .wlf-uptime-pill-dot { background: #ef4444; }
.wlf-uptime-card[data-status="paused"] .wlf-uptime-card-pill,
.wlf-uptime-card[data-status="unknown"] .wlf-uptime-card-pill,
.wlf-uptime-card[data-status="not_checked"] .wlf-uptime-card-pill {
  background: #eef0f6;
  color: #6b7a99;
}
.wlf-uptime-card[data-status="paused"] .wlf-uptime-pill-dot,
.wlf-uptime-card[data-status="unknown"] .wlf-uptime-pill-dot,
.wlf-uptime-card[data-status="not_checked"] .wlf-uptime-pill-dot { background: #94a3b8; }

/* 30-day status strip */
.wlf-uptime-bars {
  display: flex;
  gap: 2px;
  margin-top: 12px;
  height: 18px;
}
.wlf-uptime-bar {
  flex: 1;
  min-width: 3px;
  border-radius: 2px;
  background: #22c55e;
  opacity: 0.55;
}
.wlf-uptime-bar[data-state="warn"] { background: #f59e0b; opacity: 1; }
.wlf-uptime-bar[data-state="bad"]  { background: #ef4444; opacity: 1; }
.wlf-uptime-bars-foot {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #9aa3bc;
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}

/* Error / empty / loading states (preserved) */
.wlf-uptime-error {
  text-align: center;
  font-size: 12px;
  color: #9aa3bc;
  padding: 12px;
}

/* Responsive — keep at least 1 card per row */
@media (max-width: 768px) {
  .wlf-uptime-cards { grid-template-columns: 1fr !important; }
  .wlf-uptime-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .wlf-uptime-avg { text-align: left; }
}

/* ============================================================
   FORMS SYSTEM HEALTH WIDGET (Forms page — iframe embed)
   ============================================================ */
.wlf-forms-widget-wrap {
  max-width: 1000px;
  margin: 24px auto 0;
  padding: 0;
}
.wlf-forms-widget-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9aa3bc;
  margin-bottom: 12px;
  padding-left: 4px;
}
.wlf-forms-widget-iframe {
  width: 100%;
  max-width: 1000px;
  display: block;
  border: none;
  overflow: hidden;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
}
@media (max-width: 768px) {
  .wlf-forms-widget-wrap { padding: 0 12px; }
  .wlf-forms-widget-iframe { height: 1400px; }
}

/* ============================================================
   SYSTEM HEALTH CARDS (Overview page)
   ============================================================ */
.wlf-system-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.wlf-system-card {
  background: #f8f9fc;
  border: 1px solid #e8eaf0;
  border-radius: 10px;
  padding: 16px;
  border-left: 4px solid #e8eaf0;
}

.wlf-system-card.callrail { border-left-color: #3b82f6; }
.wlf-system-card.intaker  { border-left-color: #8b5cf6; }
.wlf-system-card.partner  { border-left-color: #f59e0b; }
.wlf-system-card.facebook { border-left-color: #06b6d4; }
.wlf-system-card.other    { border-left-color: #94a3b8; }

.wlf-system-card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7a99;
  margin-bottom: 10px;
}

.wlf-system-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #374151;
  padding: 3px 0;
}

.wlf-system-card-value {
  font-weight: 700;
  color: #1e2a4a;
}

/* ============================================================
   BREAKDOWN WITH PERCENTAGE (Overview page)
   ============================================================ */
.wlf-breakdown-pct {
  font-size: 12px;
  color: #9aa3bc;
  width: 48px;
  text-align: right;
  flex-shrink: 0;
}

/* ============================================================
   ALL-CLEAR MESSAGE (Overview page)
   ============================================================ */
.wlf-all-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  font-size: 14px;
  font-weight: 600;
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
}

/* ============================================================
   ZAP GROUPS (Zapier page — collapsible sections)
   ============================================================ */
.wlf-zap-group {
  margin-bottom: 12px;
  border: 1px solid #e8eaf0;
  border-radius: 10px;
  overflow: hidden;
}

.wlf-zap-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #f8f9fc;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.wlf-zap-group-header:hover {
  background: #f0f2f7;
}

.wlf-zap-group-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #1e2a4a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wlf-zap-group-chevron {
  font-size: 10px;
  color: #9aa3bc;
  transition: transform 0.2s ease;
}

.wlf-zap-group.collapsed .wlf-zap-group-chevron {
  transform: rotate(-90deg);
}

.wlf-zap-group-stats {
  font-size: 12px;
  color: #6b7a99;
  display: flex;
  gap: 16px;
}

.wlf-zap-group-body {
  padding: 0;
}

.wlf-zap-group.collapsed .wlf-zap-group-body {
  display: none;
}

.wlf-zap-group-body .wlf-zap-table {
  margin: 0;
}

.wlf-zap-group-body .wlf-zap-table td:first-child {
  padding-left: 18px;
}

/* Partner sub-group header within the Partners group */
.wlf-partner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: #f4f5f9;
  cursor: pointer;
  user-select: none;
  border-top: 1px solid #e8eaf0;
}

.wlf-partner-header:first-child {
  border-top: none;
}

.wlf-partner-header:hover {
  background: #eef0f5;
}

.wlf-partner-title {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wlf-partner-stats {
  font-size: 11px;
  color: #9aa3bc;
}

.wlf-partner-body {
  padding: 0;
}

.wlf-partner-group.collapsed .wlf-partner-body {
  display: none;
}

.wlf-partner-body .wlf-zap-table td:first-child {
  padding-left: 32px;
}

/* ============================================================
   SYSTEM BADGE (Intakes table)
   ============================================================ */
.wlf-system-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

.wlf-system-badge.callrail { background: #dbeafe; color: #1d4ed8; }
.wlf-system-badge.intaker  { background: #ede9fe; color: #6d28d9; }
.wlf-system-badge.facebook { background: #cffafe; color: #0e7490; }
.wlf-system-badge.partner  { background: #fef3c7; color: #b45309; }
.wlf-system-badge.other    { background: #f1f5f9; color: #475569; }

/* ============================================================
   UTM PARAMETER BUILDER
   ============================================================ */

.wlf-utm-builder .wlf-header {
  margin-bottom: 28px;
}

.wlf-utm-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 28px;
}

/* Label above each input */
.wlf-utm-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #6b7a99;
  margin-bottom: 6px;
}

.wlf-utm-hint {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: #9aa3bc;
  margin-left: 6px;
}

/* Shared input / select styles */
.wlf-utm-input,
.wlf-utm-search,
.wlf-utm-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #e8eaf0;
  border-radius: 6px;
  font-size: 14px;
  color: #1e2a4a;
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.wlf-utm-input:focus,
.wlf-utm-search:focus,
.wlf-utm-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

/* Source search sits above the select */
.wlf-utm-field .wlf-utm-search {
  margin-bottom: 6px;
}

/* Select arrow */
.wlf-utm-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7a99' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

/* Three-column row for Practice / Case Type / Sub Case Type */
.wlf-utm-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* ── Output section ── */
.wlf-utm-output {
  background: #f8f9fc;
  border: 1px solid #e8eaf0;
  border-radius: 8px;
  padding: 20px;
}

.wlf-utm-output-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #6b7a99;
  margin-bottom: 14px;
}

.wlf-utm-empty {
  color: #9aa3bc;
  font-size: 13px;
}

/* Individual param rows */
.wlf-utm-params {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.wlf-utm-param-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.wlf-utm-key {
  font-size: 12px;
  font-weight: 600;
  color: #6b7a99;
  min-width: 120px;
  flex-shrink: 0;
}

.wlf-utm-val {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  color: #1e2a4a;
  word-break: break-all;
}

/* Full query string box */
.wlf-utm-query-wrap {
  margin-top: 12px;
}

.wlf-utm-query {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  color: #1e2a4a;
  background: #ffffff;
  border: 1px solid #e8eaf0;
  border-radius: 6px;
  padding: 12px 14px;
  word-break: break-all;
  white-space: pre-wrap;
  min-height: 40px;
  margin-bottom: 10px;
  line-height: 1.6;
}

.wlf-utm-copy-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  background: #3b82f6;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.wlf-utm-copy-btn:hover {
  background: #2563eb;
}

.wlf-utm-copy-btn:active {
  background: #1d4ed8;
}

/* ============================================================
   RESPONSIVE — TABLET (max 768px) — new additions
   ============================================================ */
@media (max-width: 768px) {
  .wlf-uptime-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .wlf-system-cards {
    grid-template-columns: 1fr;
  }

  .wlf-utm-row {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   EXECUTIVE OVERVIEW — KPI CARDS
   ============================================================ */
.wlf-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.wlf-kpi-card {
  background: #f8f9fc;
  border-radius: 12px;
  padding: 20px 16px 16px;
  text-align: center;
  border: 1px solid #e8eaf0;
  transition: box-shadow 0.15s ease;
}

.wlf-kpi-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.wlf-kpi-value {
  font-size: 32px;
  font-weight: 800;
  color: #1e2a4a;
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.wlf-kpi-value.wlf-kpi-good {
  color: #16a34a;
}

.wlf-kpi-value.wlf-kpi-warn {
  color: #d97706;
}

.wlf-kpi-value.wlf-kpi-bad {
  color: #dc2626;
}

.wlf-kpi-check {
  font-weight: 800;
}

.wlf-kpi-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9aa3bc;
}

.wlf-kpi-trend {
  margin-top: 6px;
  min-height: 16px;
}

/* ============================================================
   EXECUTIVE OVERVIEW — HERO STATUS BANNER
   ============================================================ */
.wlf-hero-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 28px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.wlf-hero-banner.operational {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #bbf7d0;
  color: #15803d;
}

.wlf-hero-banner.degraded {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  color: #92400e;
}

.wlf-hero-banner.down {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 1px solid #fecaca;
  color: #991b1b;
}

.wlf-hero-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  animation: wlf-pulse 2s ease-in-out infinite;
}

.wlf-hero-banner.operational .wlf-hero-dot {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

.wlf-hero-banner.degraded .wlf-hero-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
  animation: wlf-pulse-amber 2s ease-in-out infinite;
}

.wlf-hero-banner.down .wlf-hero-dot {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
  animation: wlf-pulse-red 1.5s ease-in-out infinite;
}

@keyframes wlf-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2); }
  50%      { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.08); }
}

@keyframes wlf-pulse-amber {
  0%, 100% { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2); }
  50%      { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.08); }
}

@keyframes wlf-pulse-red {
  0%, 100% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25); }
  50%      { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0.05); }
}

.wlf-hero-icon {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1;
}

.wlf-hero-text {
  flex: 1;
}

.wlf-hero-subtitle {
  font-size: 12px;
  font-weight: 500;
  margin-top: 2px;
  opacity: 0.75;
}

/* ============================================================
   EXECUTIVE OVERVIEW — SYSTEM STATUS CARDS
   ============================================================ */
.wlf-system-status-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.wlf-system-status-card {
  background: #ffffff;
  border: 1px solid #e8eaf0;
  border-radius: 12px;
  padding: 20px;
  border-left: 4px solid #e8eaf0;
  transition: box-shadow 0.15s ease;
}

.wlf-system-status-card:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.wlf-system-status-card.callrail { border-left-color: #3b82f6; }
.wlf-system-status-card.intaker  { border-left-color: #8b5cf6; }
.wlf-system-status-card.partner  { border-left-color: #f59e0b; }
.wlf-system-status-card.facebook { border-left-color: #06b6d4; }
.wlf-system-status-card.other    { border-left-color: #94a3b8; }

.wlf-ssc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.wlf-ssc-title {
  font-size: 15px;
  font-weight: 700;
  color: #1e2a4a;
  line-height: 1.2;
}

.wlf-ssc-subtitle {
  font-size: 11px;
  color: #9aa3bc;
  margin-top: 2px;
  font-weight: 500;
}

.wlf-ssc-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 20px;
}

.wlf-ssc-status.operational {
  background: #dcfce7;
  color: #15803d;
}

.wlf-ssc-status.idle {
  background: #f1f5f9;
  color: #475569;
}

.wlf-ssc-status.delayed,
.wlf-ssc-status.degraded {
  background: #fef3c7;
  color: #b45309;
}

.wlf-ssc-status.down {
  background: #fee2e2;
  color: #b91c1c;
}

.wlf-ssc-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.wlf-ssc-status.operational .wlf-ssc-status-dot { background: #22c55e; }
.wlf-ssc-status.idle .wlf-ssc-status-dot         { background: #94a3b8; }
.wlf-ssc-status.delayed .wlf-ssc-status-dot,
.wlf-ssc-status.degraded .wlf-ssc-status-dot    { background: #f59e0b; }
.wlf-ssc-status.down .wlf-ssc-status-dot         { background: #ef4444; }

.wlf-ssc-check {
  font-weight: 800;
  font-size: 13px;
}

.wlf-ssc-leads {
  font-size: 28px;
  font-weight: 800;
  color: #1e2a4a;
  line-height: 1;
  letter-spacing: -0.02em;
}

.wlf-ssc-leads-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9aa3bc;
  margin-top: 4px;
}

/* Baseline explanation line on system cards (v1.9.0) — the actual-vs-
   last-week numbers, so a status color is never unexplained. */
.wlf-ssc-note {
  font-size: 11px;
  color: #6b7a99;
  margin-top: 8px;
  line-height: 1.4;
}
.wlf-ssc-note .wlf-trend { font-size: 11px; }

/* ============================================================
   EXECUTIVE OVERVIEW — TREND ARROWS
   ============================================================ */
.wlf-trend-arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}

.wlf-trend-arrow.up   { color: #16a34a; }
.wlf-trend-arrow.down { color: #dc2626; }
.wlf-trend-arrow.flat { color: #9aa3bc; }

.wlf-trend-arrow svg {
  width: 14px;
  height: 14px;
}

/* ============================================================
   EXECUTIVE OVERVIEW — ALERTS SECTION
   ============================================================ */
.wlf-alert-section {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.wlf-alert-title {
  font-size: 13px;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wlf-alert-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  color: #78350f;
  border-bottom: 1px solid rgba(253, 230, 138, 0.5);
}

.wlf-alert-item:last-child {
  border-bottom: none;
}

.wlf-alert-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  flex-shrink: 0;
}

.wlf-alert-item.critical .wlf-alert-dot {
  background: #ef4444;
}

/* ============================================================
   RESPONSIVE — OVERVIEW CARDS
   ============================================================ */
@media (max-width: 768px) {
  .wlf-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .wlf-system-status-cards {
    grid-template-columns: 1fr;
  }

  .wlf-hero-banner {
    font-size: 15px;
    padding: 18px 20px;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .wlf-hero-banner {
    font-size: 14px;
    padding: 14px 16px;
    border-radius: 8px;
  }

  .wlf-hero-dot {
    width: 12px;
    height: 12px;
  }

  .wlf-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .wlf-kpi-value {
    font-size: 24px;
  }

  .wlf-ssc-leads {
    font-size: 22px;
  }

  .wlf-system-status-card {
    padding: 14px;
  }
}

/* ── Call Routing page (v1.10.0) ─────────────────────────────────── */

.wlf-stat-sub {
  font-size: 11px;
  color: #9aa3bc;
  margin-top: 4px;
  min-height: 14px;
}

.wlf-section-sub {
  font-size: 12px;
  font-weight: 400;
  color: #9aa3bc;
  margin-left: 6px;
}

.wlf-period-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.wlf-period-card {
  background: #fff;
  border: 1px solid #eceef4;
  border-radius: 10px;
  padding: 14px 18px;
}

.wlf-period-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9aa3bc;
  margin-bottom: 6px;
}

.wlf-period-main {
  font-size: 22px;
  font-weight: 700;
  color: #1e2a4a;
}

.wlf-period-main span {
  font-size: 12px;
  font-weight: 500;
  color: #9aa3bc;
}

.wlf-period-detail {
  font-size: 12px;
  color: #6b7a99;
  margin-top: 4px;
}

.wlf-table-scroll {
  overflow-x: auto;
}

.wlf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.wlf-table th {
  padding: 12px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9aa3bc;
  white-space: nowrap;
  border-bottom: 1px solid #eceef4;
}

.wlf-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f1f5;
  color: #1e2a4a;
  white-space: nowrap;
}

.wlf-table tbody tr:hover {
  background: #f8f9fc;
}

.wlf-row-muted td {
  color: #9aa3bc;
  background: #fafbfd;
}

/* Line bubbles (v1.10.1) — color per practice area */
.wlf-line {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.wlf-line.blue   { background: #dbeafe; color: #1d4ed8; }
.wlf-line.orange { background: #ffedd5; color: #c2410c; }
.wlf-line.purple { background: #ede9fe; color: #7c3aed; }
.wlf-line.green  { background: #dcfce7; color: #15803d; }
.wlf-line.grey   { background: #f1f5f9; color: #64748b; }

/* Shared PI/EMP Spanish line: half blue, half orange */
.wlf-line.split {
  background: linear-gradient(100deg, #dbeafe 0%, #dbeafe 48%, #ffedd5 52%, #ffedd5 100%);
  color: #334155;
}

.wlf-line.unknown {
  background: transparent;
  border: 1px dashed #cbd5e1;
  color: #94a3b8;
}

/* Routing filter bar additions */
#rt-filters .wlf-filter-grow {
  flex: 1 1 220px;
}

#rt-filters .wlf-filter-grow input {
  width: 100%;
}

/* Filtered-view stats strip (v1.10.2) — visible only while filtering */
.wlf-filter-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #1e2a4a;
}

.wlf-filter-stats:not(:empty) {
  background: #f8f9fc;
  border: 1px solid #eceef4;
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 14px;
}

.wlf-filter-stats .wlf-filter-stats-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9aa3bc;
  margin-right: 4px;
}

.wlf-filter-stats .sep { color: #cbd5e1; }
.wlf-filter-stats .ai { color: #7c3aed; }
.wlf-filter-stats .human { color: #15803d; }