:root {
  /* CampaignBoss + Amazon-ish tokens  */
  --cb-primary: #d62828;
  --cb-primary-2: #f77f00;
  --cb-accent: #0077b6;
  --cb-success: #4caf50;
  --cb-warning: #f7b801;

  --cb-ink: #111827;
  --cb-muted: #6b7280;
  --cb-border: #e5e7eb;
  --cb-card: #ffffff;
  --cb-bg: #f3f4f6;

  --cb-radius-lg: 8px;
  --cb-radius-md: 8px;
  --cb-radius-sm: 8px;

  --cb-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
  --cb-shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.14);

  --cb-font: "Amazon Ember", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --cb-topbar-h: 56px;
  --cb-max: 1120px;
}

/*
  IMPORTANT:
  cb-theme.css is used on CampaignBoss site pages and may also be injected by the extension.
  Avoid applying global page resets on host pages (e.g., Amazon). Scope the few global rules
  to CampaignBoss pages (html[data-cb-page]) and CampaignBoss injected UI roots (ids starting with "cb-").
*/

/* Base box sizing for CB site pages + injected UI only */
html[data-cb-page] * { box-sizing: border-box; }
/* Extension/injected UI (keeps CB components consistent without touching host page) */
[id^="cb-"], [id^="cb-"] * { box-sizing: border-box; }

/* Full-height layout only for CB site pages */
html[data-cb-page],
html[data-cb-page] body { height: 100%; }

/* Base body styling only for CB site pages */
html[data-cb-page] body {
  margin: 0;
  font-family: var(--cb-font);
  color: var(--cb-ink);
  background: linear-gradient(180deg, #ffffff 0%, #f7f8fb 220px, #f5f7fb 100%);
}

/* =========================
   Topbar (cb-shell.js)
========================= */
.cb-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--cb-topbar-h);
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: linear-gradient(90deg, var(--cb-primary), var(--cb-primary-2));
  box-shadow: 0 10px 26px rgba(0,0,0,0.18);
}

.cb-topbar-inner {
  width: 100%;
  max-width: var(--cb-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.cb-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.cb-brand .cb-logo {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.28);
  border: 1px solid rgba(255,255,255,0.35);
}

.cb-nav {
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.cb-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  color: rgba(255,255,255,0.95);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
  transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.cb-nav a:hover { transform: translateY(-1px); background: rgba(255,255,255,0.22); }
.cb-nav a.is-active { background: rgba(0,0,0,0.18); border-color: rgba(255,255,255,0.32); }

.cb-nav-right {
  display: inline-flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 900px) {
  .cb-topbar-inner { grid-template-columns: 1fr auto; }
  .cb-nav-right { display: none; }
}
@media (max-width: 640px) {
  .cb-nav a .cb-ico { display: none; }
}

/* =========================
   Auth layout
========================= */
.cb-auth-page {
  overflow-x: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f7f8fb 220px, #f5f7fb 100%);
}

.cb-auth-layout {
  width: min(1180px, calc(100vw - 40px));
  max-width: none;
  margin: 0 auto;
  padding: clamp(42px, 7vh, 78px) 0;
  min-height: calc(100svh - var(--cb-topbar-h));
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.72fr);
  gap: clamp(22px, 4vw, 54px);
  align-items: center;
}

.cb-auth-hero {
  padding: 0;
  min-width: 0;
}

.cb-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cb-primary);
  background: #fff;
  border: 1px solid rgba(214, 40, 40, 0.22);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  font-weight: 900;
}

.cb-auth-title {
  margin: 16px 0 12px;
  max-width: 13ch;
  color: #0f172a;
  font-size: clamp(38px, 5.2vw, 64px);
  letter-spacing: 0;
  line-height: 1.02;
}

.cb-auth-subtitle {
  margin: 0 0 18px;
  color: #475467;
  font-size: clamp(16px, 1.8vw, 20px);
  line-height: 1.5;
  max-width: 58ch;
  overflow-wrap: anywhere;
}

.cb-hero-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 12px;
}

.cb-mini-card {
  min-height: 104px;
  background: #fff;
  border: 1px solid rgba(229,231,235,0.95);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 12px 28px rgba(15,23,42,0.08);
}

.cb-mini-title {
  font-weight: 900;
  color: #0f172a;
  letter-spacing: 0;
  line-height: 1.18;
}
.cb-mini-sub {
  color: #667085;
  font-size: 13px;
  line-height: 1.35;
  margin-top: 6px;
}

.cb-hero-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  gap: 10px;
}

.cb-hero-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: #344054;
  line-height: 1.42;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.cb-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 5px;
  flex: 0 0 auto;
}
.cb-dot-blue { background: rgba(0,119,182,0.35); border: 1px solid rgba(0,119,182,0.55); }
.cb-dot-red  { background: rgba(214,40,40,0.28); border: 1px solid rgba(214,40,40,0.55); }
.cb-dot-green{ background: rgba(76,175,80,0.24); border: 1px solid rgba(76,175,80,0.55); }

.cb-hero-foot {
  margin-top: 14px;
  color: var(--cb-muted);
}
.cb-hero-foot a {
  color: var(--cb-accent);
  text-decoration: none;
  font-weight: 800;
}
.cb-hero-foot a:hover { text-decoration: underline; }

/* RIGHT card */
.cb-auth-card {
  background: var(--cb-card);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-lg);
  box-shadow: var(--cb-shadow);
  padding: clamp(20px, 3vw, 28px);
  align-self: center;
  min-width: 0;
}

.cb-card-head h2 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.08;
  letter-spacing: 0;
}
.cb-card-head p {
  margin: 8px 0 0;
  color: #667085;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.cb-banner {
  margin-top: 12px;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(239,68,68,0.22);
  background: rgba(239,68,68,0.08);
  color: #991b1b;
  font-weight: 700;
  font-size: 13px;
}
.cb-banner.is-hidden { display: none; }
.cb-banner.is-success {
  border-color: rgba(34,197,94,0.24);
  background: rgba(34,197,94,0.10);
  color: #166534;
}
.cb-banner.is-warn {
  border-color: rgba(245,158,11,0.25);
  background: rgba(245,158,11,0.10);
  color: #92400e;
}

.cb-form {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

.cb-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cb-field label {
  display: block;
  font-size: 13px;
  font-weight: 900;
  color: #111827;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.cb-field input {
  width: 100%;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--cb-border);
  background: #f9fafb;
  padding: 0 12px;
  font-size: 15px;
  outline: none;
  transition: box-shadow 120ms ease, border-color 120ms ease, background 120ms ease;
}

.cb-field input:focus {
  background: #fff;
  border-color: rgba(0,119,182,0.45);
  box-shadow: 0 0 0 4px rgba(0,119,182,0.12);
}

.cb-hint {
  margin-top: 6px;
  color: var(--cb-muted);
  font-size: 12px;
}

.cb-fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}
.cb-fieldset legend {
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 6px;
}
.cb-radio {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-right: 14px;
  font-weight: 800;
}
.cb-radio input { transform: translateY(1px); }

.cb-btn {
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--cb-border);
  background: #fff;
  font-weight: 900;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, border-color 120ms ease;
}
.cb-btn:active { transform: translateY(0); }

.cb-btn-primary {
  border: none;
  color: #fff;
  background: var(--cb-primary);
  box-shadow: 0 14px 30px rgba(214,40,40,0.26);
}
.cb-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(214,40,40,0.32);
  background: #bb2121;
}

.cb-btn-ghost {
  background: rgba(0,0,0,0.03);
  border-color: rgba(229,231,235,0.95);
  color: #111827;
}
.cb-btn-ghost:hover {
  transform: translateY(-1px);
  background: rgba(0,0,0,0.05);
}

.cb-btn.is-loading {
  opacity: 0.85;
  cursor: progress;
}

.cb-legal {
  color: var(--cb-muted);
  font-size: 12px;
  line-height: 1.35;
  margin-top: 2px;
}

.cb-alt {
  text-align: center;
  margin-top: 2px;
  font-weight: 800;
  color: #374151;
}
.cb-alt a { color: var(--cb-accent); text-decoration: none; }
.cb-alt a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 980px) {
  .cb-hero-cards { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .cb-auth-page { overflow: auto; } /* allow scroll on smaller screens */
  .cb-auth-layout {
    grid-template-columns: 1fr;
    align-items: start;
    padding-bottom: 24px;
  }
  .cb-auth-card { box-shadow: var(--cb-shadow-soft); }
}
@media (max-width: 520px) {
  .cb-auth-layout {
    width: min(100%, calc(100vw - 32px));
    padding-top: 34px;
    overflow: hidden;
  }

  .cb-auth-title {
    max-width: 100%;
    font-size: clamp(34px, 10vw, 42px);
  }

  .cb-auth-card,
  .cb-mini-card {
    width: 100%;
  }

  .cb-grid-2 { grid-template-columns: 1fr; }
}

/* =========================================================
   App bar
   ========================================================= */

:root {
  /* Feel free to tweak colors later — layout is the priority here. */
  --cb-appbar-h: 64px;
}

body.cb-has-appbar {
  padding-top: var(--cb-appbar-h);
}

/* Ensure hash/anchor jumps land below the fixed bar */
[id^="cb-sec-"] {
  scroll-margin-top: calc(var(--cb-appbar-h) + 16px);
}

.cb-appbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--cb-appbar-h);
  z-index: 2000;
  display: flex;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--cb-border, #e5e7eb);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

body.cb-dashboard-shell {
  --cb-appbar-h: 56px;
  --cb-topbar-h: 56px;
}

.cb-workspace-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--cb-appbar-h);
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.06);
}

.cb-workspace-header__inner {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cb-workspace-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #111827;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
}

.cb-workspace-header__logo {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #dc2626;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.5px;
  font-size: 12px;
}

.cb-workspace-header__name {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.2px;
  color: #0f172a;
}

.cb-workspace-header__summary {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #dc2626;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
  color: #0f172a;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13.5px;
  line-height: 1;
  font-weight: 800;
}

.cb-workspace-header__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cb-workspace-header__support {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #111827;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13.5px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
  text-decoration: none;
  font-weight: 800;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.cb-workspace-header__support:hover {
  background: #fff;
  border-color: #d1d5db;
  color: #0f172a;
  transform: none;
}

.cb-workspace-header .cb-app-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  font-size: 12.5px;
  color: #111827;
}

.cb-workspace-header .cb-app-user__dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #16a34a;
}

.cb-workspace-header .cb-app-user__email {
  display: inline-flex;
  align-items: center;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 700;
  font-size: inherit;
  box-shadow: none;
}

.cb-workspace-header #logout.cb-btn {
  height: auto;
  min-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #111827;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13.5px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
  box-shadow: none;
  font-weight: 800;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.cb-workspace-header #logout.cb-btn:hover {
  background: #fff;
  border-color: #d1d5db;
  color: #0f172a;
  transform: none;
}

.cb-appbar__inner {
  width: 100%;
  max-width: var(--cb-maxw, 1120px);
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.cb-appbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
  color: #0f172a;
  text-decoration: none;
}

.cb-appbar__logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--cb-primary, #dc2626);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  box-shadow: none;
}

.cb-appbar__brand-text {
  display: grid;
  gap: 1px;
  color: #0f172a;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.cb-appbar__name {
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
}

.cb-appbar__mode {
  color: var(--cb-muted, #667085);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
}

.cb-appbar__summary {
  flex: 1;
  min-width: 0;
  color: var(--cb-muted, #667085);
  font-size: 13px;
  font-weight: 850;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-app-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cb-app-support {
  color: #344054;
  text-decoration: none;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 999px;
}

.cb-app-support:hover {
  background: #f9fafb;
}

.cb-app-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cb-app-user__email {
  display: inline-flex;
  align-items: center;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--cb-border, #e5e7eb);
  background: #f9fafb;
  color: #344054;
  font-weight: 700;
  font-size: 13px;
}

.cb-app-user__logout.cb-btn {
  height: 40px;
  padding: 0 14px;
}

body.cb-auth-page .cb-appbar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--cb-border);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

body.cb-auth-page.cb-has-appbar {
  padding-top: 56px;
}

body.cb-auth-page .cb-appbar__inner {
  max-width: 1180px;
  padding: 0 20px;
}

body.cb-auth-page .cb-appbar__brand {
  min-width: 0;
  color: #0f172a;
  text-decoration: none;
  border: 1px solid var(--cb-border);
  border-radius: 999px;
  background: #fff;
  padding: 6px 10px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

body.cb-auth-page .cb-appbar__logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--cb-primary);
  color: #fff;
  box-shadow: none;
}

body.cb-auth-page .cb-appbar__name {
  color: #0f172a;
  font-weight: 900;
}

body.cb-auth-page .cb-topnav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

body.cb-auth-page .cb-topnav .cb-btn {
  min-height: 36px;
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 999px;
}

body.cb-auth-page .cb-topnav .cb-btn-ghost {
  background: #f9fafb;
  border-color: var(--cb-border);
  color: #344054;
  box-shadow: none;
}

body.cb-auth-page .cb-topnav .cb-btn-primary {
  background: var(--cb-primary);
  color: #fff;
}

body.cb-auth-page .cb-app-actions {
  justify-content: flex-end;
}

body.cb-auth-page .cb-app-support {
  color: #344054;
  text-decoration: none;
}

/* Make in-page anchors land nicely under fixed app bar */
[id^="cb-sec-"] {
  scroll-margin-top: calc(var(--cb-appbar-h) + 12px);
}

@media (max-width: 900px) {
  .cb-appbar__brand { min-width: 120px; }
  .cb-app-user__email { max-width: 160px; }
  .cb-appbar__summary { display: none; }
  .cb-workspace-header__brand { min-width: 0; }
  .cb-workspace-header__summary { display: none; }
}

@media (max-width: 640px) {
  .cb-app-support { display: none; }
  .cb-workspace-header__support { display: none; }
  .cb-app-user__email,
  .cb-workspace-header .cb-app-user {
    display: none;
  }

  .cb-workspace-header__inner {
    padding: 0;
    gap: 8px;
  }

  body.cb-auth-page .cb-appbar__inner {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 0 16px;
  }

  body.cb-auth-page .cb-app-actions {
    display: none;
  }

  body.cb-auth-page .cb-topnav .cb-btn {
    display: none;
  }

  body[data-cb-page="signup"] .cb-topnav a[href="/login"],
  body[data-cb-page="login"] .cb-topnav a[href="/signup"] {
    display: inline-flex;
  }

  body[data-cb-page="login"] .cb-topnav a[href="/signup"] {
    max-width: 138px;
    min-height: 38px;
    height: auto;
    padding: 6px 10px;
    line-height: 1.08;
    text-align: center;
    white-space: normal;
  }
}



/* =========================
   Creator workflow board
========================= */

/* Workflow board should span both columns of the dashboard grid */
.cb-main-grid > #cb-sec-campaigns {
  grid-column: 1 / -1;
}
.cb-wf-toolbar {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-md);
  background: rgba(255,255,255,0.72);
}

.cb-wf-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--cb-muted);
  font-size: 12px;
}

.cb-wf-bc-btn {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: var(--cb-ink);
  cursor: pointer;
}

.cb-wf-bc-btn[disabled] {
  color: var(--cb-muted);
  cursor: default;
}

.cb-wf-bc-btn.is-active {
  color: var(--cb-primary);
  font-weight: 800;
}

.cb-wf-bc-sep {
  opacity: 0.6;
}

.cb-wf-toolbar__left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cb-wf-input,
.cb-wf-select,
.cb-wf-textarea {
  font-family: var(--cb-font);
  border: 1px solid var(--cb-border);
  border-radius: 12px;
  padding: 9px 10px;
  font-size: 13px;
  background: #fff;
  color: var(--cb-ink);
}

.cb-wf-input { width: 240px; max-width: 44vw; }
.cb-wf-select { min-width: 160px; }

.cb-wf-textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
}

.cb-field-help {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--cb-muted);
}

.cb-wf-stats {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cb-wf-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--cb-border);
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  font-size: 12px;
  color: var(--cb-ink);
}

.cb-wf-stat strong { font-weight: 900; }

.cb-wf-stat--warn {
  border-color: rgba(245,158,11,0.55);
  background: rgba(245,158,11,0.12);
  color: #92400e;
}

.cb-wf-stat--ok {
  border-color: rgba(34,197,94,0.35);
  background: rgba(34,197,94,0.10);
}

.cb-wf-formgroup {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 900px) {
  .cb-wf-formgroup { grid-template-columns: 1fr; }
}

.cb-wf-details {
  margin-top: 10px;
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-md);
  background: rgba(255,255,255,0.72);
  padding: 8px 10px;
}

.cb-wf-details > summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  color: var(--cb-ink);
  list-style: none;
}

.cb-wf-details > summary::-webkit-details-marker { display: none; }

.cb-wf-details__body {
  margin-top: 10px;
}

.cb-wf-field--actions .cb-btn {
  width: 100%;
}

.cb-wf-link {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--cb-primary);
  text-decoration: none;
  font-weight: 800;
}

.cb-wf-link:hover { text-decoration: underline; }

/* Dialog (settings) */
.cb-dialog {
  border: 0;
  padding: 0;
  border-radius: 18px;
  width: min(560px, 94vw);
  box-shadow: 0 22px 60px rgba(15,23,42,0.25);
}

.cb-dialog::backdrop {
  background: rgba(15,23,42,0.55);
  backdrop-filter: blur(2px);
}

.cb-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--cb-border);
  background: rgba(255,255,255,0.92);
}

.cb-dialog__title {
  font-weight: 950;
  font-size: 14px;
  color: var(--cb-ink);
}

.cb-dialog__close {
  border: 1px solid var(--cb-border);
  border-radius: 10px;
  background: #fff;
  font-weight: 900;
  width: 32px;
  height: 32px;
  cursor: pointer;
}

.cb-dialog__body {
  padding: 14px 16px;
  background: rgba(255,255,255,0.86);
}

.cb-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--cb-border);
  background: rgba(255,255,255,0.92);
}


.cb-wf-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--cb-muted);
  user-select: none;
}

.cb-wf-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1.05fr 1.15fr 1fr;
  --cb-wf-collapse: 88px;
  transition: grid-template-columns 180ms ease;
  gap: 12px;
}

.cb-wf-grid[data-mode="campaigns"] {
  grid-template-columns: 1.05fr 1.15fr 1fr;
}

.cb-wf-grid[data-mode="products"] {
  grid-template-columns: var(--cb-wf-collapse) 1.8fr 1fr;
}

.cb-wf-grid[data-mode="details"] {
  grid-template-columns: var(--cb-wf-collapse) var(--cb-wf-collapse) 1fr;
}

.cb-wf-pane {
  border: 1px solid var(--cb-border);
  background: rgba(255,255,255,0.80);
  border-radius: var(--cb-radius-md);
  padding: 10px 10px 12px;
  min-width: 0;
}

/* When a pane is collapsed, hide the noisy content so the active column feels “full width” */
.cb-wf-grid[data-mode="products"] .cb-wf-pane:nth-child(1) .cb-wf-list,
.cb-wf-grid[data-mode="products"] .cb-wf-pane:nth-child(1) .cb-wf-pane__sub {
  display: none;
}

.cb-wf-grid[data-mode="details"] .cb-wf-pane:nth-child(1) .cb-wf-list,
.cb-wf-grid[data-mode="details"] .cb-wf-pane:nth-child(2) .cb-wf-list,
.cb-wf-grid[data-mode="details"] .cb-wf-pane:nth-child(1) .cb-wf-pane__sub,
.cb-wf-grid[data-mode="details"] .cb-wf-pane:nth-child(2) .cb-wf-pane__sub {
  display: none;
}

.cb-wf-grid[data-mode="products"] .cb-wf-pane:nth-child(1) .cb-wf-pane__title,
.cb-wf-grid[data-mode="details"] .cb-wf-pane:nth-child(1) .cb-wf-pane__title,
.cb-wf-grid[data-mode="details"] .cb-wf-pane:nth-child(2) .cb-wf-pane__title {
  text-align: center;
  font-size: 12px;
}

.cb-wf-pane__title {
  font-size: 13px;
  font-weight: 800;
  color: var(--cb-ink);
  margin-bottom: 6px;
}

.cb-wf-pane__sub {
  font-size: 11px;
  color: var(--cb-muted);
  margin-bottom: 8px;
}

.cb-wf-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(60vh, 560px);
  overflow: auto;
  padding-right: 4px;
}

.cb-wf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px;
  border: 1px solid var(--cb-border);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}

.cb-wf-row:hover { box-shadow: 0 8px 18px rgba(15,23,42,0.08); }

.cb-wf-row.is-active {
  border-color: rgba(214,40,40,0.55);
  box-shadow: 0 10px 22px rgba(214,40,40,0.12);
}

.cb-wf-row__main { min-width: 0; }
.cb-wf-row__title {
  font-size: 13px;
  font-weight: 800;
  color: var(--cb-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* Spreadsheet-style product rows (Products pane) */
.cb-wf-thead,
.cb-wf-trow {
  display: grid;
  grid-template-columns: 34px minmax(240px, 1fr) 160px 120px;
  gap: 10px;
  align-items: center;
}

.cb-wf-thead {
  padding: 8px 10px;
  border: 1px solid rgba(229,231,235,0.9);
  border-radius: 14px;
  background: #f8fafc;
}

.cb-wf-th {
  font-size: 11px;
  font-weight: 900;
  color: var(--cb-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.cb-wf-th--center { text-align: center; }
.cb-wf-th--right { text-align: right; }

.cb-wf-trow {
  padding: 10px 10px;
  border: 1px solid var(--cb-border);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}

.cb-wf-trow:hover { box-shadow: 0 8px 18px rgba(15,23,42,0.08); }

.cb-wf-trow.is-active {
  border-color: rgba(214,40,40,0.55);
  box-shadow: 0 10px 22px rgba(214,40,40,0.12);
}

.cb-wf-td { min-width: 0; }
.cb-wf-td--center {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.cb-wf-td--right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.cb-wf-td-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--cb-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-wf-td-meta {
  margin-top: 2px;
  font-size: 11px;
  color: var(--cb-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-wf-togglebtn {
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--cb-border);
  background: #fff;
  font-weight: 900;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.cb-wf-togglebtn:hover { background: #f9fafb; }

.cb-wf-togglebtn.is-on {
  border-color: rgba(214,40,40,0.55);
  background: rgba(214,40,40,0.06);
}

@media (max-width: 980px) {
  .cb-wf-thead { display: none; }
  .cb-wf-trow { grid-template-columns: 1fr; gap: 8px; }
  .cb-wf-td--center { justify-content: flex-start; }
  .cb-wf-td--right { justify-content: flex-start; }
}

.cb-wf-row__meta {
  margin-top: 2px;
  font-size: 11px;
  color: var(--cb-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.cb-wf-row__aside { display: inline-flex; align-items: center; gap: 8px; }

.cb-wf-checkbox { width: 18px; height: 18px; }
/* Workflow column bulk controls */
.cb-wf-pane__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0 10px;
}

.cb-wf-selectall {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--cb-muted);
  user-select: none;
}

.cb-wf-selectall input { width: 18px; height: 18px; }

.cb-wf-count {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 900;
  color: var(--cb-ink);
}

.cb-wf-bulk {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cb-wf-select.cb-wf-select--sm {
  min-width: 200px;
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.cb-btn.cb-btn-sm {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.cb-wf-row__check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cb-wf-rowcheck { width: 18px; height: 18px; }

.cb-wf-td--check {
  display: flex;
  justify-content: center;
  align-items: center;
}


.cb-wf-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid var(--cb-border);
}

.cb-wf-pill--muted { color: var(--cb-muted); background: #f8fafc; }
.cb-wf-pill--todo { color: #92400e; background: #fffbeb; border-color: rgba(247,184,1,0.45); }
.cb-wf-pill--progress { color: #1e40af; background: #eff6ff; border-color: rgba(0,119,182,0.35); }
.cb-wf-pill--done { color: #065f46; background: #ecfdf5; border-color: rgba(76,175,80,0.45); }
.cb-wf-pill--skipped { color: #6b7280; background: #f3f4f6; border-color: rgba(107,114,128,0.35); }

.cb-wf-mini-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--cb-border);
  background: #fff;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
}

.cb-wf-mini-btn:hover { background: #f9fafb; }

.cb-wf-form { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.cb-wf-field label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: var(--cb-muted);
  margin-bottom: 6px;
}
.cb-wf-field input,
.cb-wf-field select,
.cb-wf-field textarea { width: 100%; }

.cb-wf-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}

.cb-wf-actions__right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 980px) {
  .cb-wf-grid { grid-template-columns: 1fr; }
  .cb-wf-input { width: 100%; max-width: 100%; }
  .cb-wf-select { min-width: 0; }
  .cb-wf-list { max-height: 260px; }
}

/* =========================
   Work Queue v3 (Pivot / YouTube-style table)
   Activated by: document.documentElement.classList.add('cb-wq-pivot-mode')
========================= */

.cb-wq-pivot { margin-top: 12px; }

.cb-wq-bulkbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-start; /* keep Bulk Actions near the selected count */
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--cb-border);
  border-radius: 12px;
}

.cb-wq-bulkbar__right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: 12px; /* small gap from "X selected" */
}

.cb-wq-bulkduedate { width: 160px; }

.cb-wq-table-scroll {
  margin-top: 10px;
  border: 1px solid var(--cb-border);
  border-radius: 14px;
  overflow: auto;
  max-height: 560px;
  background: var(--cb-card);
}

.cb-wq-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.cb-wq-th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  font-weight: 700;
  color: var(--cb-ink);
  background: #f8fafc;
  border-bottom: 1px solid var(--cb-border);
  padding: 10px 10px;
  white-space: nowrap;
}

.cb-wq-th--check { width: 40px; }
.cb-wq-th--actions { width: 68px; text-align: right; }

.cb-wq-td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--cb-border);
  vertical-align: middle;
}

.cb-wq-row:hover .cb-wq-td { background: #fafafa; }

.cb-wq-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 260px;
}

.cb-wq-indent { width: var(--wq-indent, 0px); flex: 0 0 var(--wq-indent, 0px); }

.cb-wq-expander {
  width: 22px;
  height: 22px;
  border: 1px solid var(--cb-border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  color: var(--cb-muted);
}

.cb-wq-expander:hover { border-color: #cbd5e1; color: var(--cb-ink); }

.cb-wq-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--cb-border);
  color: var(--cb-muted);
  font-size: 11px;
  background: #fff;
  white-space: nowrap;
}

.cb-wq-muted { color: var(--cb-muted); }

.cb-wq-mini {
  font-size: 12px;
  color: var(--cb-muted);
}

.cb-wq-edit {
  text-align: right;
}

.cb-wq-edit button {
  padding: 6px 10px;
}

/* Drawer: reuse cb-wf-grid third pane as a right-side drawer in pivot mode */
.cb-wq-pivot-mode #cb-wf-breadcrumb { display: none; }

.cb-wq-pivot-mode #cb-wf-grid {
  position: fixed;
  right: 18px;
  top: calc(var(--cb-topbar-h) + 18px);
  width: min(420px, calc(100vw - 36px));
  max-height: calc(100vh - var(--cb-topbar-h) - 36px);
  display: none;
  z-index: 9999;
}

.cb-wq-pivot-mode #cb-wf-grid.is-open { display: block; }

.cb-wq-pivot-mode #cb-wf-grid .cb-wf-pane:nth-child(1),
.cb-wq-pivot-mode #cb-wf-grid .cb-wf-pane:nth-child(2) { display: none; }

.cb-wq-pivot-mode #cb-wf-grid .cb-wf-pane:nth-child(3) {
  box-shadow: var(--cb-shadow-soft);
  border: 1px solid var(--cb-border);
  border-radius: 16px;
  background: var(--cb-card);
}

.cb-wq-drawer-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cb-wq-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.36);
  z-index: 9998;
  display: none;
}

.cb-wq-pivot-mode.cb-wq-drawer-open .cb-wq-backdrop { display: block; }

@media (max-width: 980px) {
  .cb-wq-table-scroll { max-height: 480px; }
  .cb-wq-pivot-mode #cb-wf-grid {
    right: 10px;
    top: calc(var(--cb-topbar-h) + 10px);
    width: calc(100vw - 20px);
  }
}
