.cb-dashboard-root {
  --cb-bg: #f5f6fa;
  --cb-sidebar-bg: #181f36;
  --cb-sidebar-hover: #232b4a;
  --cb-accent: #2563eb;
  --cb-accent-strong: #1d4ed8;
  --cb-accent-deep: #1e40af;
  --cb-accent-soft: #dbeafe;
  --cb-accent-softest: #eff6ff;
  --cb-accent-border: #bfdbfe;
  --cb-accent-ring: rgba(37, 99, 235, 0.28);
  --cb-accent-text: #1e40af;
  --cb-primary: var(--cb-accent);
  --cb-primary-strong: var(--cb-accent-strong);
  --cb-primary-soft: var(--cb-accent-soft);
  --cb-success: #16a34a;
  --cb-success-strong: #15803d;
  --cb-success-soft: #dcfce7;
  --cb-success-border: #bbf7d0;
  --cb-success-text: #166534;
  --cb-warning: #f59e0b;
  --cb-warning-soft: #fef3c7;
  --cb-warning-border: #fde68a;
  --cb-warning-text: #92400e;
  --cb-danger: #dc2626;
  --cb-danger-soft: #fee2e2;
  --cb-danger-border: #fecaca;
  --cb-danger-text: #991b1b;
  --cb-surface: #ffffff;
  --cb-surface-soft: #f8fafc;
  --cb-border: #e5e7eb;
  --cb-text: #0f172a;
  --cb-muted: #64748b;
  --cb-card-bg: #fff;
  --cb-card-shadow: 0 8px 40px rgba(20,30,65,0.10), 0 1.5px 8px rgba(24,31,54,0.05);
  --cb-radius: 20px;
  --cb-sidebar-width: 240px;
  --cb-sidebar-collapsed: 64px;
  --cb-icon-size: 1.45em;
  display: flex;
  min-height: 100vh;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: var(--cb-bg);
  position: relative;
  overflow-x: hidden;
  color: #181f36;
}

.cb-dashboard-root * {
  box-sizing: border-box;
}

.cb-dashboard-root svg {
  vertical-align: middle;
}

.cb-dashboard-root .cb-sidebar {
  background: var(--cb-sidebar-bg);
  color: #fff;
  width: var(--cb-sidebar-width);
  min-width: var(--cb-sidebar-width);
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  transition: width 0.22s cubic-bezier(.6,.1,.28,1), min-width 0.22s cubic-bezier(.6,.1,.28,1);
  box-shadow: 2px 0 22px rgba(24,31,54,0.09);
  z-index: 20;
  position: fixed;
  left: 0;
  top: 0;
}

.cb-dashboard-root .cb-sidebar.collapsed {
  width: var(--cb-sidebar-collapsed);
  min-width: var(--cb-sidebar-collapsed);
}

.cb-dashboard-root .cb-logo {
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 30px 24px 20px;
  white-space: nowrap;
  user-select: none;
  color: #fff;
}

.cb-dashboard-root .cb-logo-icon,
.cb-dashboard-root .cb-nav-icon {
  color: var(--cb-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cb-dashboard-root .cb-sidebar.collapsed .cb-logo-text,
.cb-dashboard-root .cb-sidebar.collapsed .cb-nav-label {
  display: none !important;
}

.cb-dashboard-root .cb-sidebar nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}

.cb-dashboard-root .cb-nav-btn {
  background: none;
  border: none;
  color: #cfd8dc;
  text-align: left;
  font-size: 1.06em;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 28px;
  cursor: pointer;
  border-radius: 12px;
  transition: background 0.19s, color 0.19s, padding 0.16s, transform 0.1s;
  position: relative;
  outline: none;
  overflow: visible;
}

.cb-dashboard-root .cb-nav-btn:after {
  content: "";
  position: absolute;
  left: 10px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 8px;
  background: var(--cb-accent);
  opacity: 0;
  transition: opacity 0.16s;
  pointer-events: none;
}

.cb-dashboard-root .cb-nav-btn.active,
.cb-dashboard-root .cb-nav-btn:focus,
.cb-dashboard-root .cb-nav-btn:hover {
  background: linear-gradient(90deg, var(--cb-accent) 0 6%, var(--cb-sidebar-hover) 75% 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37,99,235,0.12);
}

.cb-dashboard-root .cb-nav-btn:hover {
  padding-left: 36px;
}

.cb-dashboard-root .cb-nav-btn:hover:after,
.cb-dashboard-root .cb-nav-btn.active:after {
  opacity: 1;
}

.cb-dashboard-root .cb-nav-btn:active {
  transform: scale(0.98);
}

.cb-dashboard-root .cb-sidebar.collapsed .cb-nav-btn {
  justify-content: center;
  padding: 14px 0;
}

.cb-dashboard-root .cb-sidebar.collapsed .cb-logo {
  justify-content: center;
  padding: 30px 0 18px;
}

.cb-dashboard-root #cb-sidebar-collapse {
  background: none;
  border: none;
  color: #cfd8dc;
  font-size: 1.45em;
  padding: 14px 0;
  margin: 0 0 22px;
  align-self: center;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.18s, color 0.15s;
  width: 90%;
}

.cb-dashboard-root #cb-sidebar-collapse:hover {
  background: var(--cb-sidebar-hover);
  color: var(--cb-accent);
}

.cb-dashboard-root .cb-content {
  flex: 1;
  padding: 44px 6vw 34px;
  min-width: 0;
  min-height: 100vh;
  overflow: visible;
  background: var(--cb-bg);
  margin-left: var(--cb-sidebar-width);
  transition: margin-left 0.22s cubic-bezier(.6,.1,.28,1);
}

.cb-dashboard-root .cb-sidebar.collapsed ~ .cb-content {
  margin-left: var(--cb-sidebar-collapsed);
}

.cb-dashboard-root .cb-panel {
  max-width: 1180px;
  margin: 0 auto;
  animation: cbDashboardFadeIn 0.25s ease-out;
  background: var(--cb-card-bg);
  border-radius: var(--cb-radius);
  box-shadow: var(--cb-card-shadow);
  padding: 46px 46px 38px;
  min-height: 420px;
  position: relative;
}

.cb-dashboard-root .cb-panel[hidden] {
  display: none !important;
}

.cb-dashboard-root .cb-panel h1 {
  margin: 0 0 18px;
  font-size: 2.05em;
  color: #181f36;
  font-weight: 700;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cb-dashboard-root .cb-panel p {
  font-size: 1.04em;
  color: #444;
}

.cb-dashboard-root .cb-panel-body {
  width: 100%;
}

@keyframes cbDashboardFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.cb-dashboard-root .cb-mobile-nav {
  display: none;
}

.cb-dashboard-root .cb-empty-state {
  border: 1px dashed #d8e4eb;
  border-radius: 16px;
  padding: 26px;
  background: #fbfdff;
  color: #34445a;
}

.cb-dashboard-root .cb-btn,
.cb-dashboard-login-required .cb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  background: #eef4f8;
  color: #181f36;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s, transform 0.1s;
}

.cb-dashboard-root .cb-btn:hover,
.cb-dashboard-login-required .cb-btn:hover {
  background: #dfeaf0;
  transform: translateY(-1px);
}

.cb-dashboard-root .cb-primary {
  background: var(--cb-accent);
  color: #fff;
}

.cb-dashboard-root .cb-primary:hover {
  background: #14977b;
}

.cb-dashboard-root .cb-wizard-launch-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 28px;
  align-items: start;
  padding: 28px;
  border-radius: 20px;
  background: linear-gradient(135deg, #f7fffd, #f7f9ff);
  border: 1px solid #e3f7f4;
}

.cb-dashboard-root .cb-wizard-launch-copy h2 {
  margin-top: 0;
  color: #181f36;
}

.cb-dashboard-root .cb-wizard-launch-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cb-dashboard-root .cb-wizard-name-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  color: #223046;
}

.cb-dashboard-root .cb-wizard-name-field input {
  padding: 11px 13px;
  border: 1px solid #dbe5eb;
  border-radius: 10px;
  font-size: 1rem;
}

.cb-dashboard-root .cb-wizard-status {
  min-height: 22px;
  margin: 4px 0 0;
  font-size: 0.95rem;
  color: #246b5e;
}

.cb-dashboard-root .cb-wizard-status.is-error {
  color: #b32d2e;
}

.cb-dashboard-root .cb-profile-panel {
  max-width: 620px;
  margin: 20px auto 0;
}

.cb-dashboard-root .cb-profile-form-modern {
  margin: 0;
  padding: 0;
  background: none;
}

.cb-dashboard-root .cb-profile-card {
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 6px 28px rgba(32,56,120,0.10), 0 1.5px 3px rgba(32,56,120,0.04);
  padding: 34px 28px 28px;
  display: flex;
  gap: 36px;
  align-items: flex-start;
  margin-top: 18px;
  flex-wrap: wrap;
}

.cb-dashboard-root .cb-profile-avatar-col {
  flex: 0 0 112px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cb-dashboard-root .cb-profile-avatar-wrap-modern {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
}

.cb-dashboard-root .cb-profile-avatar-wrap-modern img {
  width: 102px;
  height: 102px;
  border-radius: 15px !important;
  object-fit: cover;
  border: 4px solid #eaf8f8;
  box-shadow: 0 1.5px 8px rgba(32,56,120,0.09);
}

.cb-dashboard-root .cb-profile-upload-btn-modern {
  background: #f6fcfa;
  color: var(--cb-accent);
  border-radius: 24px;
  font-size: 1em;
  padding: 7px 16px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid #e3f7f4;
  transition: background 0.18s;
  margin-top: 4px;
  display: inline-block;
}

.cb-dashboard-root .cb-profile-upload-btn-modern:hover {
  background: #e8faf5;
  color: #14977b;
}

.cb-dashboard-root .cb-profile-fields-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 200px;
}

.cb-dashboard-root .cb-profile-field-modern {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cb-dashboard-root .cb-profile-field-modern label {
  font-size: 1em;
  color: #223046;
  font-weight: 500;
}

.cb-dashboard-root .cb-profile-field-modern input {
  padding: 10px 14px;
  font-size: 1.05em;
  border-radius: 9px;
  border: 1px solid #e6ecf3;
  background: #f8fbfc;
  color: #223046;
}

.cb-dashboard-root .cb-profile-field-modern input:focus {
  border-color: var(--cb-accent);
  outline: none;
  background: #f5fffd;
}

.cb-dashboard-root .cb-profile-field-modern input[disabled] {
  background: #f2f4f8;
  color: #8e9bab;
  opacity: 1;
  cursor: not-allowed;
}

.cb-dashboard-root .cb-profile-save-btn-modern {
  background: var(--cb-accent);
  color: #fff;
  border: none;
  border-radius: 22px;
  font-size: 1.05em;
  font-weight: 600;
  padding: 13px 28px;
  margin-top: 10px;
  cursor: pointer;
  transition: background 0.15s;
  box-shadow: 0 2px 9px rgba(26,188,156,0.10);
}

.cb-dashboard-root .cb-profile-save-btn-modern:hover {
  background: #14977b;
}

.cb-dashboard-root .cb-platform-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.cb-dashboard-root .cb-platform-card {
  border: 1px solid #e8eef5;
  border-radius: 16px;
  background: #fbfdff;
  padding: 20px;
}

.cb-dashboard-root .cb-platform-card h2 {
  margin-top: 0;
}

.cb-dashboard-login-required {
  max-width: 540px;
  margin: 60px auto;
  background: #fff;
  border-radius: 18px;
  padding: 32px;
  box-shadow: 0 8px 40px rgba(20,30,65,0.10), 0 1.5px 8px rgba(24,31,54,0.05);
  text-align: center;
}

@media (max-width: 950px) {
  .cb-dashboard-root .cb-content {
    padding: 24px 3vw 24px;
  }

  .cb-dashboard-root .cb-panel {
    padding: 28px 18px;
  }

  .cb-dashboard-root .cb-wizard-launch-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .cb-dashboard-root {
    padding-bottom: 76px;
  }

  .cb-dashboard-root .cb-sidebar,
  .cb-dashboard-root .cb-logo {
    display: none !important;
  }

  .cb-dashboard-root .cb-content {
    margin-left: 0 !important;
    padding: 18px 10px 90px !important;
  }

  .cb-dashboard-root .cb-panel {
    min-height: 340px;
    border-radius: 16px;
    padding: 22px 12px;
  }

  .cb-dashboard-root .cb-mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--cb-sidebar-bg);
    border-top: 2.5px solid var(--cb-accent);
    box-shadow: 0 -6px 24px rgba(20,30,65,0.10);
    z-index: 1001;
    justify-content: space-between;
    padding: 0 2px;
    min-height: 70px;
    align-items: center;
    overflow-x: auto;
  }

  .cb-dashboard-root .cb-mobile-nav-btn {
    flex: 1 0 70px;
    border: none;
    background: none;
    color: #b3bacd;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px 0 3px;
    font-size: 0.92em;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.17s, color 0.14s, box-shadow 0.14s;
    min-width: 62px;
  }

  .cb-dashboard-root .cb-mobile-nav-btn svg {
    margin-bottom: 2px;
    color: currentColor;
  }

  .cb-dashboard-root .cb-mobile-nav-btn.active,
  .cb-dashboard-root .cb-mobile-nav-btn:focus {
    color: var(--cb-accent);
    background: rgba(26,188,156,0.09);
    box-shadow: 0 2px 12px rgba(26,188,156,0.08);
  }

  .cb-dashboard-root .cb-mobile-nav-btn span {
    font-size: 0.78em;
    font-weight: 500;
    line-height: 1;
  }

  .cb-dashboard-root .cb-profile-card {
    flex-direction: column;
    gap: 20px;
    padding: 18px 12px 15px;
  }

  .cb-dashboard-root .cb-profile-avatar-col {
    justify-content: flex-start;
  }

  .cb-dashboard-root .cb-profile-fields-col {
    min-width: 120px;
    width: 100%;
  }
}

/* ------------------------------------------------------------------
   Phase 4 dashboard UX stabilization
------------------------------------------------------------------- */
.cb-dashboard-root .cb-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin: 0 0 26px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e6edf3;
}
.cb-dashboard-root .cb-eyebrow {
  margin: 0 0 7px !important;
  color: var(--cb-accent) !important;
  font-size: 0.78rem !important;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.cb-dashboard-root .cb-page-title {
  margin: 0 0 8px !important;
  font-size: clamp(1.55rem, 3vw, 2.15rem) !important;
  line-height: 1.08;
  color: #152034;
}
.cb-dashboard-root .cb-page-description {
  margin: 0 !important;
  max-width: 680px;
  color: #58677a !important;
}
.cb-dashboard-root .cb-page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.cb-dashboard-root .cb-card {
  background: #fff;
  border: 1px solid #e5edf3;
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(20,30,65,0.06);
}
.cb-dashboard-root .cb-card-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding: 20px 22px 0;
}
.cb-dashboard-root .cb-card-title {
  margin: 0;
  font-size: 1.08rem;
  color: #152034;
}
.cb-dashboard-root .cb-card-description {
  margin: 5px 0 0 !important;
  color: #66758a !important;
  font-size: 0.95rem !important;
}
.cb-dashboard-root .cb-card-body { padding: 18px 22px 22px; }
.cb-dashboard-root .cb-grid { display: grid; gap: 18px; }
.cb-dashboard-root .cb-stack { display: flex; flex-direction: column; gap: 14px; }
.cb-dashboard-root .cb-btn-primary,
.cb-dashboard-root .cb-primary { background: var(--cb-accent) !important; color: #fff !important; }
.cb-dashboard-root .cb-btn-primary:hover,
.cb-dashboard-root .cb-primary:hover { background: #14977b !important; }
.cb-dashboard-root .cb-btn-secondary { background: #eef5f8 !important; color: #172235 !important; }
.cb-dashboard-root .cb-btn-danger { background: #ef4444 !important; color: #fff !important; }
.cb-dashboard-root .cb-btn-ghost { background: transparent !important; color: #405064 !important; box-shadow: none !important; }
.cb-dashboard-root .cb-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.cb-dashboard-root .cb-badge-success { background: #e8fbf5; color: #087a63; border: 1px solid #b7f0df; }
.cb-dashboard-root .cb-badge-warning { background: #fff7e6; color: #a15c00; border: 1px solid #ffe0a6; }
.cb-dashboard-root .cb-badge-danger { background: #fff0f0; color: #b42318; border: 1px solid #ffc7c7; }
.cb-dashboard-root .cb-badge-muted { background: #eef2f6; color: #566476; border: 1px solid #dde5ee; }
.cb-dashboard-root .cb-alert {
  border-radius: 14px;
  padding: 13px 15px;
  border: 1px solid #dbe7ef;
  background: #f7fbfd;
  color: #34445a;
}
.cb-dashboard-root .cb-alert-success { background: #edfbf6; border-color: #c2f0df; color: #087a63; }
.cb-dashboard-root .cb-alert-warning { background: #fff9ed; border-color: #ffe0a6; color: #8a5205; }
.cb-dashboard-root .cb-alert-danger { background: #fff2f2; border-color: #ffc7c7; color: #a62218; }
.cb-dashboard-root .cb-loading-state,
.cb-dashboard-root .cb-empty-state {
  text-align: center;
  border: 1px dashed #d8e4eb;
  border-radius: 18px;
  padding: 30px;
  background: #fbfdff;
  color: #536478;
}
.cb-dashboard-root .cb-empty-state h2,
.cb-dashboard-root .cb-empty-state h3 { margin-top: 0; color: #172235; }
.cb-dashboard-root .cb-field { display: flex; flex-direction: column; gap: 7px; }
.cb-dashboard-root .cb-field-label { font-weight: 700; color: #223046; }
.cb-dashboard-root .cb-field-help { color: #738094; font-size: 0.86rem; }
.cb-dashboard-root .cb-field-error { color: #b42318; font-size: 0.86rem; margin: 5px 0 0; }
.cb-dashboard-root .cb-field-invalid input,
.cb-dashboard-root .cb-field-invalid textarea,
.cb-dashboard-root .cb-field-invalid select { border-color: #ef4444 !important; box-shadow: 0 0 0 2px rgba(239,68,68,.12) !important; }
.cb-dashboard-root .cb-dashboard-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.cb-dashboard-root .cb-stat-card {
  border: 1px solid #e5edf3;
  background: linear-gradient(135deg, #fff, #f7fffd);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 8px 28px rgba(20,30,65,0.06);
}
.cb-dashboard-root .cb-stat-card span { display:block; color:#66758a; font-weight:700; font-size:.9rem; margin-bottom:8px; }
.cb-dashboard-root .cb-stat-card strong { color:#152034; font-size:1.55rem; }

@media (max-width: 780px) {
  .cb-dashboard-root .cb-page-header { flex-direction: column; align-items: stretch; }
  .cb-dashboard-root .cb-page-actions { justify-content: stretch; }
  .cb-dashboard-root .cb-page-actions .cb-btn { flex: 1 1 auto; }
  .cb-dashboard-root .cb-dashboard-stats { grid-template-columns: 1fr; }
}

/* ───────────────────────────────────────────────
   Phase 4 shared dashboard component patterns
───────────────────────────────────────────────── */
.cb-dashboard-root .cb-page-header,
.cb-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 22px;
  margin: 0 0 24px;
}
.cb-dashboard-root .cb-eyebrow,
.cb-eyebrow {
  margin: 0 0 6px !important;
  color: #1abc9c !important;
  font-size: .78rem !important;
  font-weight: 800 !important;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.cb-dashboard-root .cb-page-title,
.cb-page-title {
  margin: 0 !important;
  font-size: clamp(1.65rem, 2.4vw, 2.3rem) !important;
  color: #101827 !important;
  line-height: 1.1;
}
.cb-dashboard-root .cb-page-description,
.cb-page-description {
  margin: 8px 0 0 !important;
  color: #64748b !important;
  max-width: 640px;
  line-height: 1.5;
}
.cb-dashboard-root .cb-page-actions,
.cb-page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}
.cb-dashboard-root .cb-card,
.cb-card {
  border: 1px solid #e4edf4;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 6px 26px rgba(15, 23, 42, .06);
  padding: 20px;
}
.cb-dashboard-root .cb-card-header,
.cb-card-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.cb-dashboard-root .cb-card-title,
.cb-card-title { margin: 0; color: #152033; font-weight: 800; }
.cb-dashboard-root .cb-card-description,
.cb-card-description { margin: 4px 0 0 !important; color: #64748b !important; }
.cb-dashboard-root .cb-grid,
.cb-grid { display: grid; gap: 16px; }
.cb-dashboard-root .cb-stack,
.cb-stack { display: flex; flex-direction: column; gap: 14px; }
.cb-dashboard-root .cb-btn-primary,
.cb-btn-primary,
.cb-dashboard-root .cb-primary { background: #1abc9c; color: #fff; }
.cb-dashboard-root .cb-btn-primary:hover,
.cb-btn-primary:hover { background: #14977b; }
.cb-dashboard-root .cb-btn-secondary,
.cb-btn-secondary { background: #eef4f8; color: #182338; }
.cb-dashboard-root .cb-btn-danger,
.cb-btn-danger { background: #fee2e2; color: #991b1b; }
.cb-dashboard-root .cb-btn-danger:hover,
.cb-btn-danger:hover { background: #fecaca; }
.cb-dashboard-root .cb-btn-ghost,
.cb-btn-ghost { background: transparent; color: #334155; border: 1px solid #dce8ee; }
.cb-dashboard-root .cb-badge,
.cb-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: .78rem;
  line-height: 1;
  font-weight: 800;
  white-space: nowrap;
  border: 1px solid transparent;
}
.cb-dashboard-root .cb-badge-success,
.cb-badge-success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.cb-dashboard-root .cb-badge-warning,
.cb-badge-warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.cb-dashboard-root .cb-badge-danger,
.cb-badge-danger { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.cb-dashboard-root .cb-badge-muted,
.cb-badge-muted { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.cb-dashboard-root .cb-field-label,
.cb-field-label { font-weight: 750; color: #243247; }
.cb-dashboard-root .cb-field-help,
.cb-field-help { color: #64748b; font-size: .9rem; }
.cb-dashboard-root .cb-field-error,
.cb-field-error { color: #b91c1c; font-weight: 650; font-size: .88rem; margin: 6px 0 0; }
.cb-dashboard-root .cb-field-invalid input,
.cb-dashboard-root .cb-field-invalid textarea,
.cb-dashboard-root .cb-field-invalid select { border-color: #ef4444 !important; box-shadow: 0 0 0 2px rgba(239,68,68,.14); }
.cb-dashboard-root .cb-alert,
.cb-alert {
  border-radius: 14px;
  padding: 13px 15px;
  border: 1px solid #dce8ee;
  background: #f8fafc;
  color: #334155;
  margin: 10px 0;
}
.cb-dashboard-root .cb-alert-success,
.cb-alert-success { background: #ecfdf5; border-color: #bbf7d0; color: #166534; }
.cb-dashboard-root .cb-alert-warning,
.cb-alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.cb-dashboard-root .cb-alert-danger,
.cb-alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.cb-dashboard-root .cb-section,
.cb-section {
  border: 1px solid #e4edf4;
  border-radius: 18px;
  background: #fff;
  padding: 20px;
  margin-bottom: 16px;
}
.cb-dashboard-root .cb-section-title,
.cb-section-title { margin: 0 0 8px; color: #152033; font-size: 1.08rem; }
.cb-dashboard-root .cb-empty-state,
.cb-empty-state { text-align: center; }
.cb-dashboard-root .cb-empty-state h2,
.cb-empty-state h2 { margin-top: 0; color: #152033; }
@media (max-width: 720px) {
  .cb-dashboard-root .cb-page-header,
  .cb-page-header { flex-direction: column; }
  .cb-dashboard-root .cb-page-actions,
  .cb-page-actions { justify-content: flex-start; width: 100%; }
}

/* ------------------------------------------------------------------
 * Phase 4 shared dashboard app components
 * ------------------------------------------------------------------ */
.cb-dashboard-root .cb-page-header,
.cb-page-header {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:22px;
  margin:0 0 24px;
}
.cb-dashboard-root .cb-page-header.compact,
.cb-page-header.compact { margin-bottom:16px; padding-right:38px; }
.cb-dashboard-root .cb-eyebrow,
.cb-eyebrow { margin:0 0 6px!important; color:#1abc9c!important; text-transform:uppercase; letter-spacing:.09em; font-size:.78rem!important; font-weight:800; }
.cb-dashboard-root .cb-page-title,
.cb-page-title { margin:0!important; font-size:2rem; line-height:1.1; color:#172033; font-weight:800; }
.cb-dashboard-root .cb-page-description,
.cb-page-description { margin:8px 0 0!important; color:#627083!important; max-width:720px; line-height:1.55; }
.cb-dashboard-root .cb-page-actions,
.cb-page-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; flex-wrap:wrap; }
.cb-dashboard-root .cb-card,
.cb-card { border:1px solid #e5edf5; border-radius:18px; background:#fff; padding:18px; box-shadow:0 8px 24px rgba(24,31,54,.05); }
.cb-dashboard-root .cb-card-header h3,
.cb-card-header h3 { margin:0 0 6px; color:#172033; }
.cb-dashboard-root .cb-card-header p,
.cb-card-header p { margin:0; color:#66768a; line-height:1.45; }
.cb-dashboard-root .cb-grid,
.cb-grid { display:grid; gap:18px; }
.cb-dashboard-root .cb-stack,
.cb-stack { display:flex; flex-direction:column; gap:14px; }
.cb-dashboard-root .cb-btn,
.cb-btn { text-decoration:none!important; }
.cb-dashboard-root .cb-btn-primary,
.cb-btn-primary,
.cb-dashboard-root .cb-primary { background:#1abc9c!important; color:#fff!important; }
.cb-dashboard-root .cb-btn-primary:hover,
.cb-btn-primary:hover { background:#14977b!important; }
.cb-dashboard-root .cb-btn-secondary,
.cb-btn-secondary { background:#eef4f8!important; color:#172033!important; }
.cb-dashboard-root .cb-btn-danger,
.cb-btn-danger { background:#fee2e2!important; color:#b91c1c!important; }
.cb-dashboard-root .cb-btn-danger:hover,
.cb-btn-danger:hover { background:#fecaca!important; }
.cb-dashboard-root .cb-btn-ghost,
.cb-btn-ghost { background:transparent!important; color:#172033!important; }
.cb-dashboard-root .cb-badge,
.cb-badge { display:inline-flex; align-items:center; justify-content:center; gap:6px; border-radius:999px; padding:6px 10px; font-size:.78rem; font-weight:800; line-height:1; white-space:nowrap; border:1px solid transparent; }
.cb-dashboard-root .cb-badge-success,
.cb-badge-success { background:#dcfce7; color:#166534; border-color:#bbf7d0; }
.cb-dashboard-root .cb-badge-warning,
.cb-badge-warning { background:#fef3c7; color:#92400e; border-color:#fde68a; }
.cb-dashboard-root .cb-badge-danger,
.cb-badge-danger { background:#fee2e2; color:#991b1b; border-color:#fecaca; }
.cb-dashboard-root .cb-badge-muted,
.cb-badge-muted { background:#f1f5f9; color:#475569; border-color:#e2e8f0; }
.cb-dashboard-root .cb-field,
.cb-field { border:1px solid #d9e3ec; border-radius:11px; padding:10px 12px; min-height:42px; background:#fff; color:#172033; }
.cb-dashboard-root .cb-field:focus,
.cb-field:focus { outline:2px solid rgba(26,188,156,.18); border-color:#1abc9c; }
.cb-dashboard-root .cb-field-label,
.cb-field-label { display:block; font-weight:700; color:#29384d; margin-bottom:6px; }
.cb-dashboard-root .cb-field-help,
.cb-field-help { display:block; color:#718096; font-size:.9rem; margin-top:5px; }
.cb-dashboard-root .cb-field-error,
.cb-field-error { display:block; color:#b91c1c; font-weight:700; font-size:.86rem; margin-top:5px; }
.cb-dashboard-root .cb-field-invalid .cb-field,
.cb-field-invalid .cb-field { border-color:#ef4444; box-shadow:0 0 0 2px rgba(239,68,68,.08); }
.cb-dashboard-root .cb-empty-state,
.cb-empty-state { text-align:center; color:#425166; }
.cb-empty-state-large { padding:44px 24px!important; }
.cb-empty-state h3 { margin:0 0 8px; color:#172033; font-size:1.35rem; }
.cb-loading-state { border:1px dashed #d8e4eb; border-radius:16px; padding:32px; background:#fbfdff; color:#34445a; text-align:center; font-weight:700; }
.cb-alert { border-radius:14px; border:1px solid #d9e3ec; background:#f8fafc; color:#334155; padding:12px 14px; margin:12px 0; }
.cb-alert p { margin:.3rem 0 0!important; }
.cb-alert-success { background:#ecfdf5; border-color:#bbf7d0; color:#14532d; }
.cb-alert-warning { background:#fffbeb; border-color:#fde68a; color:#78350f; }
.cb-alert-danger { background:#fef2f2; border-color:#fecaca; color:#7f1d1d; }
.cb-section { border:1px solid #e6edf4; border-radius:18px; padding:18px; background:#fff; margin-bottom:18px; }
.cb-section-title { margin:0 0 10px; color:#172033; font-size:1.1rem; }
.cb-summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin:0 0 18px; }
.cb-summary-card { border:1px solid #e8eef5; border-radius:16px; padding:16px; background:linear-gradient(135deg,#fff,#f8fbfd); }
.cb-summary-card span { display:block; color:#718096; font-size:.84rem; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.cb-summary-card strong { display:block; color:#172033; font-size:1.45rem; margin-top:5px; }
@media (max-width: 860px) {
  .cb-dashboard-root .cb-page-header,
  .cb-page-header { flex-direction:column; align-items:stretch; }
  .cb-dashboard-root .cb-page-actions,
  .cb-page-actions { justify-content:flex-start; }
  .cb-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .cb-dashboard-root .cb-page-title,
  .cb-page-title { font-size:1.55rem; }
  .cb-summary-grid { grid-template-columns:1fr; }
}

/* v4.7.0 top-level workflow dashboard */
.cb-dashboard-root { min-height: 100vh; }
.cb-workflow-root, .cb-workflow-page { width: 100%; box-sizing: border-box; }
.cb-workflow-page { display: grid; gap: 18px; }
.cb-workflow-selector { margin-bottom: 4px; }
.cb-bot-selector { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border: 1px solid #dfe7ee; border-radius: 16px; background: #fff; box-shadow: 0 8px 24px rgba(15, 23, 42, .04); }
.cb-bot-selector label { font-weight: 800; color: #0f172a; }
.cb-bot-selector select, .cb-workflow-page input, .cb-workflow-page select, .cb-workflow-page textarea { border: 1px solid #cbd5e1; border-radius: 10px; padding: 9px 11px; background: #fff; color: #0f172a; box-sizing: border-box; }
.cb-bot-selector select { min-width: min(360px, 100%); }
.cb-workflow-grid { display: grid; gap: 16px; }
.cb-workflow-grid-two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.cb-setup-wizard-card .cb-wizard-card-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.cb-inline-status { color: #0f766e; font-weight: 700; }
.cb-workflow-form-card .cb-settings-form { margin: 0; }
.cb-layout-workspace .cb-layout-form { margin: 0; }
.cb-layout-embed-section { margin-top: 16px; }
.cb-embed-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.cb-code-box { width: 100%; min-height: 110px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px; line-height: 1.5; background: #0f172a; color: #e2e8f0; border: 0 !important; border-radius: 12px; padding: 12px; resize: vertical; }
.cb-knowledge-workspace { display: grid; gap: 16px; }
.cb-usage-banner { display: flex; gap: 10px; flex-wrap: wrap; color: #475569; font-weight: 700; }
.cb-dropzone { border: 1.5px dashed #b7c4d5; border-radius: 16px; background: #f8fafc; padding: 18px; display: flex; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 16px; position: relative; }
.cb-dropzone p { margin: 4px 0 0; color: #64748b; }
.cb-dropzone-hover { border-color: #1abc9c; background: #ecfdf5; }
.cb-doc-table-wrap { width: 100%; overflow: auto; }
.cb-doc-table { width: 100%; border-collapse: collapse; }
.cb-doc-table th, .cb-doc-table td { padding: 10px 12px; border-bottom: 1px solid #e5e7eb; text-align: left; vertical-align: top; }
.cb-crawl-row { display: flex; gap: 10px; flex-wrap: wrap; }
.cb-crawl-row input { flex: 1 1 320px; }
.cb-doc-editor-card textarea { min-height: 260px; }
.cb-logs-app .cb-page-header { margin-top: 0; }
.cb-conversation-ai-panel { margin-top: 20px; padding: 16px; border: 1px solid #dbeafe; border-radius: 16px; background: #eff6ff; }
.cb-ai-suggested-prompts { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.cb-ai-custom-question { display: grid; gap: 10px; }
.cb-ai-custom-question textarea { width: 100%; min-height: 72px; }
.cb-ai-answer { margin-top: 12px; padding: 12px; border-radius: 12px; background: #fff; border: 1px solid #bfdbfe; }
.cb-ai-answer-body { margin-top: 8px; line-height: 1.55; }
.cb-bot-workflow-actions { align-items: center; }
.cb-bots-overview-grid { margin: 0 0 18px; }
.cb-settings-workflow .cb-profile-card.compact { box-shadow: none; border: 0; padding: 0; }
.cb-settings-workflow .cb-platform-grid, .cb-settings-workflow .cb-profile-panel { margin: 0; }
.cb-nav-btn[data-panel="home"], .cb-mobile-nav-btn[data-panel="home"] { display: none !important; }
@media (max-width: 860px) {
  .cb-bot-selector { align-items: stretch; flex-direction: column; }
  .cb-bot-selector select { width: 100%; }
  .cb-dropzone { align-items: stretch; flex-direction: column; }
  .cb-crawl-row { flex-direction: column; }
  .cb-crawl-row input, .cb-crawl-row button { width: 100%; }
}

/* v4.7.0 workflow-specific section visibility */
#cb-workflow-bot-settings .cb-editor-section[data-section="appearance"],
#cb-workflow-bot-settings .cb-editor-section[data-section="launcher"] {
  display: none !important;
}
#cb-workflow-bot-settings .cb-editor-settings-header .cb-eyebrow::after {
  content: " · Top-level workflow";
}
#cb-workflow-bot-layout .cb-layout-workspace,
#cb-workflow-bot-layout .cb-layout-embed-section,
#cb-workflow-bot-settings .cb-workflow-form-card,
#cb-workflow-knowledge .cb-knowledge-workspace,
#cb-workflow-logs .cb-workflow-logs-pane {
  max-width: 1180px;
}
#cb-workflow-bot-layout .cb-layout-form {
  width: 100%;
}
#cb-workflow-logs .cb-logs-app .cb-page-header {
  display: none;
}


/* ------------------------------------------------------------------
   v4.7.3 dashboard shell: full-width panels, top bar, profile modal
------------------------------------------------------------------- */
.cb-dashboard-root {
  align-items: stretch;
}
.cb-dashboard-root .cb-main-region {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--cb-sidebar-width);
  display: flex;
  flex-direction: column;
  transition: margin-left 0.22s cubic-bezier(.6,.1,.28,1);
  background: var(--cb-bg);
}
.cb-dashboard-root .cb-sidebar.collapsed ~ .cb-main-region {
  margin-left: var(--cb-sidebar-collapsed);
}
.cb-dashboard-root .cb-topbar {
  position: sticky;
  top: 0;
  z-index: 1200;
  min-height: 74px;
  margin: 0;
  padding: 14px 20px;
  border-bottom: 1px solid #e4ebf3;
  background: rgba(245,246,250,.94);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.cb-dashboard-root .cb-topbar-title-block {
  min-width: 0;
}
.cb-dashboard-root .cb-topbar-eyebrow {
  margin: 0 0 3px;
  color: var(--cb-accent);
  text-transform: uppercase;
  font-size: .72rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: .13em;
}
.cb-dashboard-root .cb-topbar-title {
  margin: 0;
  font-size: clamp(1.15rem, 1.8vw, 1.55rem);
  line-height: 1.1;
  font-weight: 850;
  color: #101827;
}
.cb-dashboard-root .cb-topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}
.cb-dashboard-root .cb-topbar-bot {
  min-width: 160px;
  max-width: 260px;
  border: 1px solid #e1eaf2;
  border-radius: 999px;
  background: #fff;
  padding: 7px 13px;
  box-shadow: 0 8px 24px rgba(24,31,54,.04);
}
.cb-dashboard-root .cb-topbar-bot-label {
  display: block;
  color: #738197;
  font-size: .68rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
  margin-bottom: 3px;
}
.cb-dashboard-root .cb-topbar-bot strong {
  display: block;
  color: #172033;
  font-size: .88rem;
  line-height: 1.1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cb-dashboard-root .cb-dashboard-logout-pill {
  border: 1px solid rgba(239, 68, 68, .26);
  border-radius: 999px;
  background: #fff;
  color: #b42318;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  text-decoration: none;
  font-size: .84rem;
  font-weight: 850;
  line-height: 1;
  box-shadow: 0 8px 24px rgba(24,31,54,.05);
  transition: transform .12s, border-color .12s, box-shadow .12s, background .12s, color .12s;
}
.cb-dashboard-root .cb-dashboard-logout-pill:hover,
.cb-dashboard-root .cb-dashboard-logout-pill:focus {
  outline: none;
  border-color: rgba(239, 68, 68, .48);
  background: #fff7f7;
  color: #991b1b;
  box-shadow: 0 10px 28px rgba(239, 68, 68, .12);
  transform: translateY(-1px);
}
.cb-dashboard-root .cb-dashboard-logout-pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(239, 68, 68, .1);
  color: #b42318;
  font-size: .82rem;
  line-height: 1;
}
@media (max-width: 760px) {
  .cb-dashboard-root .cb-dashboard-logout-pill {
    min-height: 40px;
    padding: 0 12px;
  }
  .cb-dashboard-root .cb-dashboard-logout-pill span:not(.cb-dashboard-logout-pill-icon) {
    display: none;
  }
}

.cb-dashboard-root .cb-profile-pill {
  border: 1px solid #dbe7ef;
  border-radius: 999px;
  background: #fff;
  color: #172033;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  max-width: 280px;
  padding: 5px 8px 5px 5px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(24,31,54,.06);
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.cb-dashboard-root .cb-profile-pill:hover,
.cb-dashboard-root .cb-profile-pill:focus {
  outline: none;
  border-color: rgba(26,188,156,.65);
  box-shadow: 0 10px 28px rgba(26,188,156,.11);
  transform: translateY(-1px);
}
.cb-dashboard-root .cb-profile-pill-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--cb-accent), #119a80);
  color: #fff;
  font-weight: 900;
  font-size: .82rem;
  flex: 0 0 auto;
}
.cb-dashboard-root .cb-profile-pill-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.cb-dashboard-root .cb-profile-pill-copy strong,
.cb-dashboard-root .cb-profile-pill-copy span {
  max-width: 170px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cb-dashboard-root .cb-profile-pill-copy strong {
  font-size: .88rem;
  line-height: 1.15;
}
.cb-dashboard-root .cb-profile-pill-copy span {
  color: #69778a;
  font-size: .73rem;
  line-height: 1.15;
}
.cb-dashboard-root .cb-profile-pill-caret {
  color: #64748b;
  font-size: .8rem;
  padding-left: 2px;
}
.cb-dashboard-root .cb-content {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  margin-left: 0 !important;
  padding: 20px;
  min-width: 0;
}
.cb-dashboard-root .cb-panel {
  width: 100%;
  max-width: none;
  margin: 0;
  border-radius: 20px;
  padding: clamp(24px, 2.6vw, 42px);
}
.cb-dashboard-root .cb-panel > .cb-workflow-root,
.cb-dashboard-root .cb-panel > .cb-workflow-page,
.cb-dashboard-root .cb-workflow-root,
.cb-dashboard-root .cb-workflow-page,
.cb-dashboard-root .cb-layout-workspace,
.cb-dashboard-root .cb-layout-embed-section,
.cb-dashboard-root .cb-knowledge-workspace,
.cb-dashboard-root .cb-workflow-logs-pane,
#cb-workflow-bot-layout .cb-layout-workspace,
#cb-workflow-bot-layout .cb-layout-embed-section,
#cb-workflow-bot-settings .cb-workflow-form-card,
#cb-workflow-knowledge .cb-knowledge-workspace,
#cb-workflow-logs .cb-workflow-logs-pane {
  width: 100%;
  max-width: none !important;
}
.cb-dashboard-root .cb-page-description {
  max-width: 920px;
}
.cb-dashboard-root .cb-bot-selector {
  width: 100%;
}
.cb-dashboard-root .cb-bot-selector select {
  flex: 1 1 420px;
  min-width: min(520px, 100%);
}
.cb-modal-open {
  overflow: hidden;
}
.cb-dashboard-root .cb-profile-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15,23,42,.45);
  backdrop-filter: blur(4px);
}
.cb-dashboard-root .cb-profile-modal-overlay[hidden] {
  display: none !important;
}
.cb-dashboard-root .cb-profile-modal-dialog {
  position: relative;
  width: min(680px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15,23,42,.24);
  border: 1px solid #e1e9f2;
  padding: 28px;
}
.cb-dashboard-root .cb-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f1f5f9;
  color: #334155;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}
.cb-dashboard-root .cb-modal-close:hover {
  background: #e2e8f0;
}
.cb-dashboard-root .cb-profile-modal-header {
  display: flex;
  gap: 18px;
  align-items: center;
  padding-right: 38px;
  margin-bottom: 22px;
}
.cb-dashboard-root .cb-profile-modal-avatar-wrap img {
  width: 88px;
  height: 88px;
  border-radius: 20px !important;
  object-fit: cover;
  border: 4px solid #eaf8f8;
  box-shadow: 0 8px 24px rgba(32,56,120,.10);
}
.cb-dashboard-root .cb-profile-modal-header h2 {
  margin: 0;
  color: #172033;
  font-size: 1.65rem;
}
.cb-dashboard-root .cb-profile-modal-subtitle {
  margin: 7px 0 0 !important;
  color: #64748b !important;
  line-height: 1.45;
}
.cb-dashboard-root .cb-profile-modal-form {
  display: grid;
  gap: 16px;
}
.cb-dashboard-root .cb-profile-upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.cb-dashboard-root .cb-profile-upload-help {
  color: #718096;
  font-size: .9rem;
}
.cb-dashboard-root .cb-profile-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.cb-dashboard-root .cb-profile-modal-actions .cb-profile-save-btn-modern {
  margin-top: 0;
}
.cb-dashboard-root .cb-settings-workflow .cb-profile-panel,
.cb-dashboard-root .cb-settings-workflow #cb-profile-form {
  display: none !important;
}
@media (max-width: 950px) {
  .cb-dashboard-root .cb-topbar {
    flex-direction: column;
    align-items: stretch;
  }
  .cb-dashboard-root .cb-topbar-actions {
    justify-content: space-between;
  }
}
@media (max-width: 700px) {
  .cb-dashboard-root .cb-main-region {
    margin-left: 0 !important;
  }
  .cb-dashboard-root .cb-topbar {
    padding: 12px 10px;
    gap: 10px;
  }
  .cb-dashboard-root .cb-content {
    padding: 10px 10px 90px !important;
  }
  .cb-dashboard-root .cb-panel {
    padding: 18px 12px;
  }
  .cb-dashboard-root .cb-topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .cb-dashboard-root .cb-topbar-bot,
  .cb-dashboard-root .cb-profile-pill {
    max-width: none;
    width: 100%;
  }
  .cb-dashboard-root .cb-profile-pill-copy strong,
  .cb-dashboard-root .cb-profile-pill-copy span {
    max-width: calc(100vw - 120px);
  }
  .cb-dashboard-root .cb-profile-modal-overlay {
    padding: 12px;
  }
  .cb-dashboard-root .cb-profile-modal-dialog {
    padding: 22px 16px;
  }
  .cb-dashboard-root .cb-profile-modal-header {
    flex-direction: column;
    align-items: flex-start;
    padding-right: 34px;
  }
}

/* v4.7.3 profile stability pass */
.cb-dashboard-root #cb-profile-pill {
  position: relative;
  z-index: 25;
}
.cb-dashboard-root #cb-profile-modal[aria-hidden="false"] {
  display: flex;
}

/* CoreBot Goals v1 */
.cb-workflow-goals-pane { display: grid; gap: 18px; }
.cb-goals-settings-form, .cb-goal-editor-form { display: grid; gap: 14px; }
.cb-goals-settings-grid, .cb-goals-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; align-items: start; }
.cb-goals-settings-grid label, .cb-goals-form-grid label, .cb-goal-editor-form label { display: grid; gap: 6px; font-weight: 600; color: #1f2937; }
.cb-goals-settings-grid input[type="text"], .cb-goals-settings-grid input[type="number"], .cb-goals-settings-grid select,
.cb-goals-form-grid input, .cb-goals-form-grid select, .cb-goal-editor-form textarea, .cb-goal-editor-form input, .cb-goal-editor-form select {
  width: 100%; border: 1px solid #d8dee8; border-radius: 10px; padding: 10px 12px; background: #fff; color: #111827; box-sizing: border-box;
}
.cb-toggle-row { display: flex !important; grid-template-columns: none !important; align-items: flex-start; gap: 10px !important; padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; }
.cb-toggle-row input[type="checkbox"] { width: auto !important; margin-top: 2px; }
.cb-toggle-row span { display: grid; gap: 2px; }
.cb-toggle-row small { color: #6b7280; font-weight: 400; }
.cb-toggle-row-master { border-color: #b7e7db; background: #f1fffb; }
.cb-goals-dependent { display: grid; gap: 16px; }
.cb-goals-launcher-panel { padding: 14px; border: 1px solid #e5e7eb; border-radius: 14px; background: #f8fafc; }
.cb-goals-launcher-panel h3, .cb-goals-analytics-card h3 { margin: 0 0 12px; }
.cb-goals-table-wrap { overflow-x: auto; }
.cb-goals-table { width: 100%; border-collapse: collapse; }
.cb-goals-table th, .cb-goals-table td { padding: 10px 12px; border-bottom: 1px solid #eef2f7; text-align: left; vertical-align: top; }
.cb-goals-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }
.cb-goals-table small { color: #64748b; }
.cb-goals-actions { white-space: nowrap; display: flex; flex-wrap: wrap; gap: 6px; }
.cb-btn-small { padding: 6px 9px !important; font-size: 12px !important; }
.cb-goals-json-details { border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px; background: #fbfdff; }
.cb-goals-json-details summary { cursor: pointer; font-weight: 700; }
.cb-goals-summary-grid { margin-bottom: 18px; }
.cb-inline-status-success { color: #047857; }
.cb-inline-status-danger { color: #b91c1c; }
.cb-inline-status-muted { color: #64748b; }
@media (max-width: 720px) {
  .cb-goals-settings-grid, .cb-goals-form-grid { grid-template-columns: 1fr; }
  .cb-goals-actions { white-space: normal; }
}

/* ------------------------------------------------------------------
   v5.1.1 dashboard shell polish: fixed header + content-only scroll
   and compact panel headers. Page titles now live in the topbar only.
------------------------------------------------------------------- */
body.cb-dashboard-active {
  overflow: hidden;
}
body.cb-dashboard-active #wpbody-content {
  padding-bottom: 0 !important;
}
body.cb-dashboard-active #wpfooter {
  display: none !important;
}
.cb-dashboard-root {
  height: calc(100vh - 32px);
  min-height: 0 !important;
  overflow: hidden !important;
}
body:not(.admin-bar) .cb-dashboard-root {
  height: 100vh;
}
.cb-dashboard-root .cb-main-region {
  height: 100%;
  min-height: 0 !important;
  overflow: hidden !important;
}
.cb-dashboard-root .cb-topbar {
  flex: 0 0 auto;
  position: relative !important;
  top: auto !important;
}
.cb-dashboard-root .cb-content {
  flex: 1 1 auto;
  min-height: 0 !important;
  height: auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 20px !important;
  scrollbar-gutter: stable;
}
.cb-dashboard-root .cb-panel {
  min-height: 100%;
  padding: clamp(18px, 2vw, 30px) !important;
}
.cb-dashboard-root .cb-panel .cb-page-header.cb-panel-page-header {
  margin: 0 0 18px !important;
  padding: 0 !important;
  border-bottom: 0 !important;
  min-height: 0 !important;
}
.cb-dashboard-root .cb-panel .cb-page-header.cb-panel-page-header .cb-duplicate-panel-title-block {
  display: none !important;
}
.cb-dashboard-root .cb-panel .cb-page-header.cb-panel-page-header.cb-page-header-empty {
  display: none !important;
  margin: 0 !important;
}
.cb-dashboard-root .cb-panel .cb-page-header.cb-panel-page-header.cb-page-header-actions-only {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 12px !important;
}
.cb-dashboard-root .cb-panel .cb-page-header.cb-panel-page-header.cb-page-header-actions-only .cb-page-actions {
  margin-left: auto;
}
@media (max-width: 782px) {
  .admin-bar .cb-dashboard-root {
    height: calc(100vh - 46px);
  }
}
@media (max-width: 700px) {
  .cb-dashboard-root {
    height: 100vh;
  }
  body.cb-dashboard-active {
    overflow: hidden;
  }
  .cb-dashboard-root .cb-content {
    padding: 10px 10px 88px !important;
  }
  .cb-dashboard-root .cb-panel {
    padding: 16px 12px !important;
  }
}

/* ------------------------------------------------------------------
   v5.1.2 dashboard scroll containment hotfix
   Prevent the WordPress/page wrapper from creating a second outer
   scrollbar. Only the CoreBot content pane should scroll.
------------------------------------------------------------------- */
html.cb-dashboard-active,
body.cb-dashboard-active {
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
}
body.cb-dashboard-active {
  overscroll-behavior: none;
}
body.cb-dashboard-active #page,
body.cb-dashboard-active .site,
body.cb-dashboard-active .site-content,
body.cb-dashboard-active .entry-content,
body.cb-dashboard-active .wp-site-blocks,
body.cb-dashboard-active #content,
body.cb-dashboard-active .content-area,
body.cb-dashboard-active main,
body.cb-dashboard-active article,
body.cb-dashboard-active #wpwrap,
body.cb-dashboard-active #wpcontent,
body.cb-dashboard-active #wpbody,
body.cb-dashboard-active #wpbody-content {
  max-height: 100vh !important;
  overflow: hidden !important;
}
body.cb-dashboard-active .cb-dashboard-root {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  margin: 0 !important;
  overflow: hidden !important;
}
body.admin-bar.cb-dashboard-active .cb-dashboard-root {
  top: 32px !important;
  height: calc(100vh - 32px) !important;
  max-height: calc(100vh - 32px) !important;
}
body.cb-dashboard-active .cb-dashboard-root .cb-sidebar {
  top: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
}
body.admin-bar.cb-dashboard-active .cb-dashboard-root .cb-sidebar {
  top: 32px !important;
  height: calc(100vh - 32px) !important;
  max-height: calc(100vh - 32px) !important;
}
body.admin-bar.cb-dashboard-active .cb-dashboard-root {
  top: 32px !important;
}
body.cb-dashboard-active .cb-dashboard-root .cb-main-region {
  height: 100% !important;
  max-height: 100% !important;
}
body.cb-dashboard-active .cb-dashboard-root .cb-content {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 782px) {
  body.admin-bar.cb-dashboard-active .cb-dashboard-root {
    top: 46px !important;
    height: calc(100vh - 46px) !important;
    max-height: calc(100vh - 46px) !important;
  }
  body.admin-bar.cb-dashboard-active .cb-dashboard-root .cb-sidebar {
    top: 46px !important;
    height: calc(100vh - 46px) !important;
    max-height: calc(100vh - 46px) !important;
  }
}


/* v5.5.3.7 mobile workflow bot selector compact fix */
@media (max-width: 700px) {
  .cb-dashboard-root .cb-workflow-selector,
  .cb-workflow-selector {
    margin-bottom: 10px !important;
  }

  .cb-dashboard-root .cb-bot-selector,
  .cb-bot-selector {
    width: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 10px 12px !important;
    border-radius: 18px !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    align-items: center !important;
    gap: 7px !important;
    box-sizing: border-box !important;
  }

  .cb-dashboard-root .cb-bot-selector label,
  .cb-bot-selector label {
    display: block !important;
    font-size: 11px !important;
    line-height: 1.1 !important;
    letter-spacing: .12em !important;
    text-transform: uppercase !important;
    color: #738197 !important;
    margin: 0 !important;
    font-weight: 800 !important;
  }

  .cb-dashboard-root .cb-bot-selector select,
  .cb-bot-selector select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    flex: none !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 8px 38px 8px 12px !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
    border-radius: 14px !important;
    box-sizing: border-box !important;
    appearance: auto !important;
    -webkit-appearance: menulist !important;
  }

  .cb-dashboard-root .cb-bot-selector .cb-inline-status,
  .cb-bot-selector .cb-inline-status,
  .cb-dashboard-root .cb-bot-selector .cb-status-badge,
  .cb-bot-selector .cb-status-badge,
  .cb-dashboard-root .cb-bot-selector [class*="status"],
  .cb-bot-selector [class*="status"] {
    justify-self: start !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
}


/* v5.6.1.1: electric blue dashboard accent token pass. */
.cb-dashboard-root .cb-btn-primary,
.cb-dashboard-root button.cb-btn-primary,
.cb-dashboard-root .button-primary,
.cb-dashboard-root .cb-primary-action,
.cb-dashboard-root .cb-goals-btn-primary {
  background: var(--cb-accent) !important;
  border-color: var(--cb-accent) !important;
  color: #fff !important;
  box-shadow: 0 12px 26px rgba(37,99,235,.18);
}
.cb-dashboard-root .cb-btn-primary:hover,
.cb-dashboard-root button.cb-btn-primary:hover,
.cb-dashboard-root .button-primary:hover,
.cb-dashboard-root .cb-primary-action:hover,
.cb-dashboard-root .cb-goals-btn-primary:hover {
  background: var(--cb-accent-strong) !important;
  border-color: var(--cb-accent-strong) !important;
}
.cb-dashboard-root input:focus,
.cb-dashboard-root select:focus,
.cb-dashboard-root textarea:focus,
.cb-dashboard-root button:focus-visible,
.cb-dashboard-root a:focus-visible {
  border-color: var(--cb-accent) !important;
  box-shadow: 0 0 0 3px var(--cb-accent-ring) !important;
  outline: none;
}
.cb-dashboard-root .cb-tab-btn.active,
.cb-dashboard-root .cb-pill.active,
.cb-dashboard-root .is-selected,
.cb-dashboard-root .selected:not(.status-success):not(.is-success) {
  border-color: var(--cb-accent-border) !important;
}
.cb-dashboard-root .cb-eyebrow,
.cb-dashboard-root .cb-card-kicker,
.cb-dashboard-root .cb-page-title svg,
.cb-dashboard-root .cb-panel h1 svg {
  color: var(--cb-accent) !important;
}

/* v5.6.1.1 supplemental blue overrides for legacy dashboard selectors. */
.cb-dashboard-root .cb-primary,
.cb-dashboard-root .cb-dropzone-hover,
.cb-dashboard-root .cb-upload-primary,
.cb-dashboard-root .cb-save-button,
.cb-dashboard-root .cb-action-primary {
  background: var(--cb-accent) !important;
  border-color: var(--cb-accent) !important;
  color: #fff !important;
}
.cb-dashboard-root .cb-primary:hover,
.cb-dashboard-root .cb-upload-primary:hover,
.cb-dashboard-root .cb-save-button:hover,
.cb-dashboard-root .cb-action-primary:hover {
  background: var(--cb-accent-strong) !important;
  border-color: var(--cb-accent-strong) !important;
}
.cb-dashboard-root .cb-dropzone-hover {
  background: var(--cb-accent-softest) !important;
}
.cb-dashboard-root .cb-inline-status:not(.cb-inline-status-success):not(.success):not(.is-success),
.cb-dashboard-root .cb-nav-meta,
.cb-dashboard-root .cb-brand-accent {
  color: var(--cb-accent-text) !important;
}


/* v5.7.1.3: dashboard logout/profile action layout. */
.cb-dashboard-root .cb-profile-modal-actions-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.cb-dashboard-root .cb-profile-modal-actions-main {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.cb-dashboard-root .cb-btn-danger-outline {
  border: 1px solid var(--cb-danger-border, #fecaca);
  color: var(--cb-danger-text, #991b1b);
  background: var(--cb-danger-soft, #fee2e2);
  text-decoration: none;
}
.cb-dashboard-root .cb-btn-danger-outline:hover,
.cb-dashboard-root .cb-btn-danger-outline:focus {
  border-color: var(--cb-danger, #dc2626);
  color: #fff;
  background: var(--cb-danger, #dc2626);
}
@media (max-width: 680px) {
  .cb-dashboard-root .cb-profile-modal-actions-split,
  .cb-dashboard-root .cb-profile-modal-actions-main,
  .cb-dashboard-root .cb-profile-modal-actions-split .cb-btn,
  .cb-dashboard-root .cb-profile-modal-actions-split button,
  .cb-dashboard-root .cb-profile-modal-actions-split a {
    width: 100%;
  }
  .cb-dashboard-root .cb-profile-modal-actions-main {
    justify-content: stretch;
  }
}

/* v5.8.2.5 - Guide Settings/Layout drawer polish */
.cb-guide-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 100030;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
  background: rgba(15, 23, 42, 0.48);
  opacity: 0;
  transition: opacity 220ms ease;
}

.cb-guide-drawer-overlay.is-open {
  opacity: 1;
}

.cb-guide-drawer-overlay.is-closing {
  opacity: 0;
}

.cb-guide-drawer-panel {
  width: min(1480px, calc(100vw - 56px));
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f7fbff;
  color: #0f172a;
  box-shadow: -34px 0 90px rgba(15, 23, 42, 0.30);
  transform: translateX(104%);
  transition: transform 260ms cubic-bezier(.22, 1, .36, 1);
  will-change: transform;
  outline: none;
}

.cb-guide-drawer-panel[data-size="wide"] {
  width: min(1540px, calc(100vw - 44px));
}

.cb-guide-drawer-panel[data-size="standard"] {
  width: min(1480px, calc(100vw - 56px));
}

.cb-guide-drawer-overlay.is-open .cb-guide-drawer-panel {
  transform: translateX(0);
}

.cb-guide-drawer-overlay.is-closing .cb-guide-drawer-panel {
  transform: translateX(104%);
}

.cb-guide-drawer-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 34px 22px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(247, 251, 255, 0.96);
  backdrop-filter: blur(16px);
}

.cb-guide-drawer-eyebrow {
  margin: 0 0 6px;
  color: #2563eb;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cb-guide-drawer-title {
  margin: 0;
  color: #0f172a;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  font-weight: 850;
  letter-spacing: -0.03em;
}

.cb-guide-drawer-subtitle {
  max-width: 720px;
  margin: 8px 0 0;
  color: #64748b;
  font-size: 0.96rem;
  line-height: 1.55;
}

.cb-guide-drawer-close {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 14px;
  background: #fff;
  color: #334155;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.cb-guide-drawer-close:hover,
.cb-guide-drawer-close:focus-visible {
  border-color: rgba(37, 99, 235, 0.45);
  color: #1d4ed8;
  outline: none;
}

.cb-guide-drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 28px 34px 36px;
}

.cb-guide-drawer-host .cb-editor-settings-header,
.cb-guide-drawer-host .cb-layout-hero {
  margin-top: 0;
}

.cb-guide-settings-drawer-host .cb-editor-section-grid,
.cb-guide-layout-drawer-host .cb-layout-builder {
  max-width: none;
}

.cb-guide-layout-drawer-host .cb-layout-builder {
  align-items: start;
}

@media (max-width: 760px) {
  .cb-guide-drawer-panel,
  .cb-guide-drawer-panel[data-size="wide"],
  .cb-guide-drawer-panel[data-size="standard"] {
    width: 100vw;
  }

  .cb-guide-drawer-header {
    padding: 20px 20px 16px;
  }

  .cb-guide-drawer-body {
    padding: 20px 18px 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cb-guide-drawer-overlay,
  .cb-guide-drawer-panel {
    transition: none !important;
  }

  .cb-guide-drawer-panel {
    transform: none !important;
  }
}

/* v5.9.5 - Guide quick-edit drawer routing */
.cb-guide-drawer-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.cb-guide-drawer-primary-action {
  white-space: nowrap;
  min-height: 42px;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
.cb-guide-settings-drawer-host .cb-settings-form-drawer .cb-settings-grid,
.cb-guide-layout-drawer-host .cb-layout-form-drawer .cb-layout-controls {
  gap: 18px;
}
.cb-guide-layout-drawer-host .cb-layout-form-drawer .cb-layout-builder {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 22px;
}
.cb-guide-layout-drawer-host .cb-layout-form-drawer .cb-layout-preview-rail {
  position: sticky;
  top: 0;
  align-self: start;
}
.cb-guide-layout-drawer-host .cb-layout-form-drawer .cb-layout-live-card .cb-layout-card-header p {
  display: none;
}
.cb-guide-layout-drawer-host .cb-layout-form-drawer .cb-embed-fields,
.cb-guide-layout-drawer-host .cb-layout-form-drawer .cb-layout-voice-card,
.cb-guide-layout-drawer-host .cb-layout-form-drawer .cb-layout-controls > details.cb-layout-advanced-card {
  display: none !important;
}
.cb-guide-settings-drawer-host .cb-settings-drawer-full-note,
.cb-guide-settings-drawer-host .cb-settings-drawer-advanced-note p {
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.5;
}
@media (max-width: 980px) {
  .cb-guide-layout-drawer-host .cb-layout-form-drawer .cb-layout-builder {
    grid-template-columns: 1fr;
  }
  .cb-guide-layout-drawer-host .cb-layout-form-drawer .cb-layout-preview-rail {
    position: static;
  }
}
@media (max-width: 760px) {
  .cb-guide-drawer-header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .cb-guide-drawer-header {
    flex-direction: column;
  }
}
