/* ════════════════════════════════════════════════════════════════
   PySquad CoC — design system
   Calm, low-strain palette for all-day use: light purple accent, airy
   neutrals, gentle shadows, generous radii. One token set themes every
   page (bm- components + the Bootstrap compatibility layer below).
════════════════════════════════════════════════════════════════ */
:root {
  --white:#ffffff; --off:#faf8ff; --off2:#f2eefb;
  --border:#ece7f6; --border2:#ddd5ef;
  --black:#1b2430; --dark:#2a3340; --muted:#6c7680; --muted2:#9aa4ad;
  /* RevIQ calm teal; a tenant's own primary_color still overrides in base.html */
  --accent:#7c5cdb; --accent2:#5b3fb0; --accent-light:#f1ecfc; --accent-mid:#ddd2f6;
  --green:#16a34a; --green-light:#dcfce7;
  --amber:#d97706; --amber-light:#fef3c7;
  --red:#dc2626; --red-light:#fee2e2;
  --blue:#2563eb; --blue-light:#dbeafe;
  --sidebar-w:240px; --header-h:60px;
  --radius:12px; --radius-lg:16px;
  --shadow:0 1px 2px rgba(60,40,120,.05),0 6px 20px rgba(60,40,120,.06);
  --shadow-lg:0 14px 40px rgba(60,40,120,.12);
  --transition:all .18s ease;
}

* { box-sizing:border-box; }
body {
  margin:0; background:var(--off); color:var(--dark);
  font-family:'Sora','Inter',system-ui,-apple-system,sans-serif;
  font-size:14px; line-height:1.55;
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
}
a { color:var(--accent2); text-decoration:none; }
a:hover { text-decoration:underline; }

/* ── Shell ── */
.bm-layout { display:flex; min-height:100vh; }

.bm-sidebar {
  width:var(--sidebar-w); background:var(--white);
  border-right:1px solid var(--border);
  display:flex; flex-direction:column;
  position:fixed; top:0; left:0; bottom:0; z-index:100;
  transition:var(--transition);
}
.bm-sidebar-logo {
  height:var(--header-h); display:flex; align-items:center;
  padding:0 18px; border-bottom:1px solid var(--border); gap:10px;
}
.bm-logo-mark {
  width:30px; height:30px; border-radius:9px;
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-weight:800; font-size:12px; letter-spacing:.02em; flex-shrink:0;
}
.bm-logo-text { font-weight:700; font-size:22px; color:var(--dark); letter-spacing:.02em; }
.bm-logo-text span { color:var(--accent); }

.bm-nav { flex:1; padding:10px 10px; overflow-y:auto; }
.bm-nav-label {
  font-size:10px; font-weight:700; color:var(--muted2);
  text-transform:uppercase; letter-spacing:.12em; padding:12px 10px 6px;
}
.bm-nav-item {
  display:flex; align-items:center; gap:10px; padding:9px 12px;
  border-radius:var(--radius); color:var(--muted);
  font-size:13px; font-weight:500; cursor:pointer; transition:var(--transition);
  margin-bottom:2px; position:relative;
}
.bm-nav-item i { font-size:16px; width:18px; text-align:center; flex-shrink:0; }
.bm-nav-item:hover { background:var(--off2); color:var(--dark); text-decoration:none; }
.bm-nav-item.active { background:var(--accent-light); color:var(--accent2); font-weight:600; }
.bm-nav-item.active i { color:var(--accent); }
.bm-nav-item.active::before { content:""; position:absolute; left:-2px; top:8px; bottom:8px; width:3px; border-radius:3px; background:var(--accent); }
.bm-nav-badge {
  margin-left:auto; background:var(--accent); color:#fff; font-size:10px;
  font-weight:700; padding:1px 7px; border-radius:20px; min-width:18px; text-align:center;
}
.bm-nav-badge--alert { background:var(--red); }

.bm-sidebar-footer { border-top:1px solid var(--border); padding:10px 8px; }
.bm-user-row { display:flex; align-items:center; gap:8px; padding:8px 10px; border-radius:10px; }
.bm-user-row:hover { background:var(--off); }
.bm-avatar {
  width:34px; height:34px; border-radius:9px; background:var(--accent); color:#fff;
  display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px; flex-shrink:0;
}
.bm-user-info { flex:1; min-width:0; }
.bm-user-name { font-size:13px; font-weight:600; color:var(--dark); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bm-user-role { font-size:11px; color:var(--muted2); }
.bm-action-btn {
  display:flex; align-items:center; justify-content:center; width:30px; height:30px;
  border-radius:7px; color:var(--muted2); font-size:15px; transition:var(--transition);
}
.bm-action-btn:hover { background:#e5e7eb; color:var(--dark); text-decoration:none; }
.bm-action-btn.active { background:var(--accent-light); color:var(--accent); }
.bm-action-btn--logout:hover { background:var(--red-light); color:var(--red); }

/* ── Lead detail tabs ── */
.lead-tabs { display:flex; gap:0; flex-wrap:wrap; border-bottom:2px solid var(--border); margin-bottom:0; padding:0; list-style:none; }
.lead-tabs .nav-item { list-style:none; }
.lead-tabs .nav-link {
  display:inline-flex; align-items:center; gap:6px; padding:10px 16px;
  color:var(--muted); font-size:13px; font-weight:600; background:transparent;
  border:none; border-bottom:2px solid transparent; margin-bottom:-2px;
  border-radius:8px 8px 0 0; transition:var(--transition); white-space:nowrap;
}
.lead-tabs .nav-link:hover:not(.active) { color:var(--dark); background:var(--off2); }
.lead-tabs .nav-link.active { color:var(--accent2); border-bottom-color:var(--accent); }
.lead-tabs .nav-link i { font-size:13px; }
.lead-tab-content { padding-top:24px; }

/* ── Settings tabs ── */
.settings-tabs { display:flex; gap:8px; flex-wrap:wrap; padding:0; margin-bottom:20px; }
.settings-tabs .nav-item { list-style:none; }
.settings-tabs .nav-link { color:var(--muted); font-size:13px; font-weight:600;
  padding:8px 16px; border-radius:999px; border:1px solid var(--border); background:var(--white); }
.settings-tabs .nav-link i { margin-right:6px; }
.settings-tabs .nav-link:hover:not(.active) { background:var(--off2); color:var(--dark); }
.settings-tabs .nav-link.active { color:#fff; background:var(--accent); border-color:var(--accent); }

/* ── Main + topbar ── */
.bm-main { margin-left:var(--sidebar-w); flex:1; min-width:0; display:flex; flex-direction:column; min-height:100vh; }
.bm-topbar {
  height:var(--header-h); background:var(--white); border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
  padding:0 28px; position:sticky; top:0; z-index:50; gap:16px;
}
.bm-topbar-title { font-size:15px; font-weight:700; color:var(--dark); }
.bm-topbar-right { display:flex; align-items:center; gap:10px; margin-left:auto; }
.bm-code-chip {
  display:inline-block; font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:12px; font-weight:700; letter-spacing:.03em; color:var(--accent);
  background:var(--accent-light); border:1px solid var(--accent);
  padding:2px 8px; border-radius:6px; white-space:nowrap;
}
.doc-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:10px; }
.doc-item { display:flex; align-items:center; gap:10px; padding:10px 12px; border:1px solid var(--border); border-radius:10px; background:var(--off); }
.doc-ic { font-size:22px; color:var(--accent); flex:0 0 auto; }
.doc-meta { min-width:0; flex:1; }
.doc-name { font-size:13px; font-weight:600; color:var(--dark); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.doc-sub { font-size:11px; color:var(--muted); }
.doc-actions { flex:0 0 auto; }
.is-saving { opacity:.6; }
.is-saved { border-color:var(--green)!important; box-shadow:0 0 0 3px var(--green-light)!important; }
.is-error { border-color:var(--red)!important; box-shadow:0 0 0 3px var(--red-light)!important; }
.bm-live-chip {
  position:fixed; left:50%; bottom:22px; transform:translateX(-50%);
  background:var(--dark); color:#fff; font-size:12.5px; font-weight:600;
  padding:8px 16px; border-radius:999px; box-shadow:var(--shadow); z-index:200;
  display:flex; align-items:center; gap:6px;
}
.bm-live-chip a { color:#fff; text-decoration:underline; }

/* Multi-select picker cards (target accounts / team members) */
.pick-tools { display:flex; gap:6px; }
.pick-tool {
  border:1px solid var(--border); background:var(--white); color:var(--muted);
  font-size:11.5px; font-weight:600; padding:3px 10px; border-radius:7px; cursor:pointer;
  transition:var(--transition);
}
.pick-tool:hover { border-color:var(--accent); color:var(--accent); }
.pick-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:10px; }
.pick-card {
  position:relative; display:flex; align-items:center; gap:10px; margin:0;
  padding:11px 12px; border:1.5px solid var(--border); border-radius:11px;
  background:var(--white); cursor:pointer; transition:var(--transition); user-select:none;
}
.pick-card:hover { border-color:var(--accent-mid); background:var(--off); }
.pick-card input { position:absolute; opacity:0; width:0; height:0; }
.pick-card.is-on { border-color:var(--accent); background:var(--accent-light); }
.pick-ic, .pick-avatar {
  flex:0 0 auto; width:34px; height:34px; border-radius:9px;
  display:flex; align-items:center; justify-content:center; font-size:16px; font-weight:700;
}
.pick-avatar { background:var(--accent-mid); color:var(--accent2); text-transform:uppercase; }
.pick-body { min-width:0; flex:1; display:flex; flex-direction:column; }
.pick-title { font-size:13px; font-weight:600; color:var(--dark); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pick-sub { font-size:11px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pick-check {
  flex:0 0 auto; width:20px; height:20px; border-radius:50%; border:1.5px solid var(--border);
  display:flex; align-items:center; justify-content:center; color:transparent; font-size:12px;
  transition:var(--transition);
}
.pick-card.is-on .pick-check { background:var(--accent); border-color:var(--accent); color:#fff; }

/* AI Studio wizard */
.wiz-steps { display:flex; gap:8px; margin-bottom:14px; flex-wrap:wrap; }
.wiz-dot {
  display:flex; align-items:center; gap:8px; padding:8px 14px; border-radius:10px;
  border:1px solid var(--border); background:var(--white); color:var(--muted);
  font-size:13px; font-weight:600; cursor:pointer; transition:var(--transition); flex:1; min-width:130px;
}
.wiz-dot .n {
  width:22px; height:22px; border-radius:50%; background:var(--off); color:var(--muted);
  display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; flex:0 0 auto;
}
.wiz-dot.is-active { border-color:var(--accent); background:var(--accent-light); color:var(--accent2); }
.wiz-dot.is-active .n { background:var(--accent); color:#fff; }
.wiz-dot.is-done { color:var(--dark); }
.wiz-dot.is-done .n { background:var(--green); color:#fff; }
@media (max-width:560px){ .wiz-dot .t { display:none; } .wiz-dot { flex:0 0 auto; min-width:0; } }
.wiz-step { display:none; }
.wiz-step.is-active { display:block; animation:wizfade .18s ease; }
@keyframes wizfade { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }
.wiz-nav { display:flex; align-items:center; gap:8px; margin-top:20px; padding-top:16px; border-top:1px solid var(--border); }
.wiz-review { display:flex; flex-direction:column; gap:2px; }
.wiz-rev-row { display:flex; justify-content:space-between; gap:16px; padding:10px 2px; border-bottom:1px solid var(--border); font-size:13.5px; }
.wiz-rev-row span { color:var(--muted); }
.wiz-rev-row strong { color:var(--dark); text-align:right; max-width:60%; }
.wiz-progress { padding:20px 4px; }
.wiz-prog-label { font-size:14px; font-weight:600; color:var(--dark); margin-bottom:12px; }
.wiz-prog-track { height:8px; border-radius:999px; background:var(--off); overflow:hidden; }
.wiz-prog-bar { height:100%; width:0; background:var(--accent); border-radius:999px; transition:width .5s ease; }
.bm-topbar-search { position:relative; display:flex; align-items:center; }
.bm-topbar-search i { position:absolute; left:11px; color:var(--muted2); font-size:14px; pointer-events:none; }
.bm-topbar-search input {
  height:36px; width:260px; max-width:38vw; padding:0 12px 0 32px;
  border:1px solid var(--border); border-radius:9px; background:var(--off);
  font-size:13px; color:var(--dark); transition:var(--transition);
}
.bm-topbar-search input:focus { outline:none; background:var(--white); border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-light); }
@media (max-width:640px){ .bm-topbar-search input { width:150px; } }
.bm-tenant-chip {
  display:flex; align-items:center; gap:8px; padding:6px 12px;
  background:var(--off); border:1px solid var(--border); border-radius:20px; font-size:12px; font-weight:600; color:var(--dark);
}
.bm-tenant-chip i { color:var(--accent); }

.bm-content { flex:1; min-width:0; padding:28px; max-width:1500px; }

/* ── Dashboard fixed-viewport layout ── */
.dashboard-content {
  height:calc(100vh - var(--header-h));
  overflow:hidden;
  display:flex;
  flex-direction:column;
  padding-bottom:16px;
}
.dash-bottom { flex:1; min-height:0; overflow:hidden; }
.dash-bottom > .row { height:100%; }
.dash-card-full { height:100%; display:flex; flex-direction:column; }
.dash-card-scroll { flex:1; min-height:0; overflow-y:auto; }

/* Pagination bar */
.pg-bar { display:flex; align-items:center; gap:8px; padding-top:10px; margin-top:6px; border-top:1px solid var(--border); }
.pg-info { font-size:12px; color:var(--muted); flex:1; text-align:center; }
.pg-btn { display:inline-flex; align-items:center; gap:4px; padding:4px 12px; border:1px solid var(--border2); border-radius:7px; background:var(--white); color:var(--dark); font-size:12px; font-weight:600; cursor:pointer; transition:var(--transition); }
.pg-btn:hover:not(:disabled) { background:var(--off2); border-color:var(--accent-mid); }
.pg-btn:disabled { opacity:.38; cursor:default; }

.bm-page-head { margin-bottom:20px; }
.bm-page-title { font-size:20px; font-weight:700; color:var(--dark); margin:0; }
.bm-page-sub { font-size:13px; color:var(--muted); margin-top:3px; }

/* ── Cards / stats ── */
.bm-card { background:var(--white); border:1px solid var(--border); border-radius:var(--radius-lg); padding:22px 24px; box-shadow:var(--shadow); }
.bm-card-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; gap:12px; }
.bm-card-title { font-size:14px; font-weight:700; color:var(--dark); }
.bm-card-sub { font-size:12px; color:var(--muted2); margin-top:2px; }

.bm-stat-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:24px; }
@media (max-width:1200px){ .bm-stat-grid{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:640px){ .bm-stat-grid{ grid-template-columns:1fr; } }
/* 8 KPI cards in a single row (compact) */
.bm-stat-grid--6 { grid-template-columns:repeat(6,1fr); gap:12px; margin-bottom:16px; }
.bm-stat-grid--6 .bm-stat { padding:14px 12px; }
.bm-stat-grid--6 .bm-stat-icon { width:32px; height:32px; font-size:15px; margin-bottom:6px; }
.bm-stat-grid--6 .bm-stat-value { font-size:22px; margin-top:2px; }
@media (max-width:1100px){ .bm-stat-grid--6{ grid-template-columns:repeat(3,1fr); } }
@media (max-width:560px){ .bm-stat-grid--6{ grid-template-columns:repeat(2,1fr); } }

.bm-stat-grid--8 { grid-template-columns:repeat(8,1fr); gap:12px; }
.bm-stat-grid--8 .bm-stat { padding:14px 14px; }
.bm-stat-grid--8 .bm-stat-icon { width:32px; height:32px; font-size:15px; margin-bottom:8px; }
.bm-stat-grid--8 .bm-stat-value { font-size:20px; margin-top:4px; }
@media (max-width:1400px){ .bm-stat-grid--8{ grid-template-columns:repeat(4,1fr); } }
@media (max-width:900px){ .bm-stat-grid--8{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:520px){ .bm-stat-grid--8{ grid-template-columns:1fr; } }
.bm-stat { background:var(--white); border:1px solid var(--border); border-radius:var(--radius-lg); padding:18px 20px; box-shadow:var(--shadow); transition:var(--transition); }
.bm-stat:hover { border-color:var(--accent-mid); box-shadow:var(--shadow-lg); }
.bm-stat-label { font-size:11px; font-weight:600; color:var(--muted2); text-transform:uppercase; letter-spacing:.06em; }
.bm-stat-value { font-size:26px; font-weight:700; color:var(--dark); margin-top:6px; letter-spacing:-.01em; }
.bm-stat-icon { width:38px; height:38px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:18px; background:var(--accent-light); color:var(--accent); margin-bottom:10px; }

/* ── Table ── */
.bm-table-wrap { overflow-x:auto; border-radius:var(--radius-lg); border:1px solid var(--border); box-shadow:var(--shadow); background:var(--white); }
.bm-table { width:100%; border-collapse:collapse; background:var(--white); }
.bm-table thead tr { background:var(--off); border-bottom:1px solid var(--border); }
.bm-table th { padding:11px 16px; font-size:11px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.08em; text-align:left; white-space:nowrap; }
.bm-table td { padding:13px 16px; font-size:13px; color:var(--dark); border-bottom:1px solid var(--border); vertical-align:middle; }
.bm-table tbody tr:last-child td { border-bottom:none; }
.bm-table tbody tr { transition:var(--transition); }
.bm-table tbody tr:hover { background:var(--off); }
.bm-row-click { cursor:pointer; }
.bm-table tbody tr.row-posted { background:var(--green-light); }
.bm-table tbody tr.row-due { background:var(--red-light); }
.bm-table tbody tr.row-rejected { background:var(--amber-light); }
.legend-swatch { display:inline-block; width:11px; height:11px; border-radius:3px; margin-right:4px; vertical-align:-1px; }
.bm-topbar-ws { font-size:13px; font-weight:600; color:var(--muted); display:inline-flex; align-items:center; gap:6px; }

/* Content pipeline: filters + single-row tabs + fit-to-width table */
.content-filters { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
/* Square stage tiles — count number on top, stage name below; one flush row */
.stage-tabs { display:flex; gap:8px; align-items:stretch; }
.stage-tab { flex:1 1 0; min-width:0; display:flex; flex-direction:column; align-items:center;
  justify-content:center; gap:4px; padding:12px 6px; border:1px solid var(--border);
  border-radius:10px; background:var(--white); color:var(--muted); text-decoration:none;
  transition:var(--transition); }
.stage-tab:hover:not(.active) { background:var(--off2); color:var(--dark); }
.stage-tab.active { background:var(--accent); border-color:var(--accent); color:#fff; }
.stage-tab-count { font-size:20px; font-weight:800; line-height:1; }
.stage-tab-label { font-size:11px; font-weight:600; text-align:center; white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis; max-width:100%; }
.content-table-wrap { overflow-x:visible; }
.content-table { table-layout:auto; width:100%; }
.content-table th, .content-table td { padding:9px 10px; }
.content-table th { white-space:normal; }
.content-table td:first-child, .content-table th:first-child { padding-left:12px; }

/* ── Badges ── */
.bm-badge { display:inline-flex; align-items:center; gap:4px; padding:3px 9px; border-radius:20px; font-size:11px; font-weight:600; }
.bm-badge-green,.bm-badge-success { background:var(--green-light); color:#15803d; }
.bm-badge-amber,.bm-badge-warning { background:var(--amber-light); color:#92400e; }
.bm-badge-red,.bm-badge-danger { background:var(--red-light); color:#991b1b; }
.bm-badge-blue,.bm-badge-info { background:var(--blue-light); color:#1d4ed8; }
.bm-badge-accent { background:var(--accent-light); color:var(--accent); }
.bm-badge-gray,.bm-badge-secondary { background:var(--off2); color:var(--muted); }
/* Toggleable label chips (pickers) */
.label-check { cursor:pointer; user-select:none; margin:0; }
.label-check input { position:absolute; opacity:0; pointer-events:none; }
.label-check .bm-badge { opacity:.4; transition:opacity .12s, box-shadow .12s; }
.label-check input:checked + .bm-badge { opacity:1; box-shadow:0 0 0 1.5px currentColor inset; }
.label-check input:disabled ~ .bm-badge { cursor:default; }
.bm-badge-purple { background:#f3e8ff; color:#7e22ce; }
.bm-badge-teal { background:#ccfbf1; color:#0f766e; }
.bm-badge-pink { background:#fce7f3; color:#be185d; }

/* ── Buttons ── */
/* Uniform sizing: every button shares one height + horizontal padding so rows of
   buttons line up. bm-btn-sm is the only smaller variant (icon/table actions). */
.bm-btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:40px; padding:0 18px; border-radius:8px; font-size:14px; font-weight:600; line-height:1; cursor:pointer; border:none; transition:var(--transition); font-family:inherit; text-decoration:none; white-space:nowrap; }
.bm-btn:hover { text-decoration:none; }
.bm-btn-primary { background:var(--accent); color:#fff; }
.bm-btn-primary:hover { background:var(--accent2); transform:translateY(-1px); box-shadow:0 4px 16px rgba(124,92,219,.30); color:#fff; }
.bm-btn-outline { background:transparent; color:var(--dark); border:1px solid var(--border2); }
.bm-btn-outline:hover { background:var(--off); border-color:var(--accent-mid); }
.bm-btn-danger { background:var(--red-light); color:var(--red); border:1px solid #fca5a5; }
.bm-btn-danger:hover { background:var(--red); color:#fff; }
.bm-btn-success { background:var(--green); color:#fff; }
.bm-btn-success:hover { background:#15803d; transform:translateY(-1px); color:#fff; }
.bm-btn-sm { min-height:32px; padding:0 12px; font-size:12.5px; }
.bm-btn-block { width:100%; justify-content:center; }

/* ── Progress / gauge ── */
.bm-progress { height:8px; background:var(--off2); border-radius:20px; overflow:hidden; }
.bm-progress-bar { height:100%; background:var(--accent); border-radius:20px; }

/* ── Pipeline timeline / agent steps ── */
.agent-step { border-left:3px solid var(--border); padding-left:12px; padding-top:6px; padding-bottom:6px; }
.agent-step.done { border-left-color:var(--green); }
.agent-step.running { border-left-color:var(--blue); }
.agent-step.failed { border-left-color:var(--red); }
pre.io { background:#0d1117; color:#c9d1d9; padding:.75rem; border-radius:.5rem; max-height:340px; overflow:auto; font-size:.78rem; }

/* ── Forms ── */
.bm-label { display:block; font-size:14px; font-weight:600; color:var(--dark); margin-bottom:6px; }
.bm-help { font-size:12.5px; color:var(--muted2); margin-top:5px; }
.bm-input, .bm-textarea, .bm-select {
  width:100%; padding:11px 14px; border:1px solid var(--border2); border-radius:9px;
  font-size:15px; font-family:inherit; color:var(--dark); background:var(--white); transition:var(--transition);
}
.bm-input:focus,.bm-textarea:focus,.bm-select:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-light); }
.bm-input-sm.bm-input,.bm-select-sm.bm-select { width:auto; padding:6px 10px; font-size:12.5px; border-radius:7px; }
/* Spacing utility for auth forms (which load coc.css only, not Bootstrap). */
.mb-3 { margin-bottom:16px; }

/* ── Alerts ── */
.bm-alert { padding:12px 16px; border-radius:10px; font-size:13px; border:1px solid; margin-bottom:14px; display:flex; gap:10px; align-items:flex-start; }
.bm-alert i { margin-top:2px; }
.bm-alert-info { background:var(--accent-light); border-color:var(--accent-mid); color:var(--accent2); }
.bm-alert-success { background:var(--green-light); border-color:#bbf7d0; color:#166534; }
.bm-alert-warning { background:var(--amber-light); border-color:#fde68a; color:#92400e; }
.bm-alert-danger,.bm-alert-error { background:var(--red-light); border-color:#fecaca; color:#991b1b; }
.bm-alert-light { background:var(--off); border-color:var(--border); color:var(--dark); }

/* ── Toasts ── */
.bm-toast-area { position:fixed; top:18px; right:18px; z-index:9999; display:flex; flex-direction:column; gap:10px; }

/* ── Global loader overlay ── */
.app-loader {
  position:fixed; inset:0; z-index:12000; display:none;
  align-items:center; justify-content:center; flex-direction:column; gap:14px;
  background:rgba(244,247,246,.72); backdrop-filter:blur(2px);
}
.app-loader.show { display:flex; }
.app-loader-spinner {
  width:46px; height:46px; border-radius:50%;
  border:4px solid var(--accent-mid); border-top-color:var(--accent);
  animation:app-spin .8s linear infinite;
}
.app-loader-text { font-size:13px; font-weight:600; color:var(--accent2); letter-spacing:.02em; }
@keyframes app-spin { to { transform:rotate(360deg); } }

/* ── Kanban ── */
.kanban { display:flex; gap:16px; overflow-x:auto; padding-bottom:12px; align-items:flex-start; }
.kanban-col { flex:0 0 290px; background:var(--off2); border:1px solid var(--border); border-radius:var(--radius-lg); display:flex; flex-direction:column; max-height:calc(100vh - 180px); }
.kanban-col-head { padding:12px 14px; font-size:12px; font-weight:700; color:var(--dark); text-transform:uppercase; letter-spacing:.05em; display:flex; justify-content:space-between; align-items:center; border-bottom:1px solid var(--border); }
.kanban-col-count { background:var(--accent-mid); color:var(--accent); border-radius:20px; padding:1px 8px; font-size:11px; }
.kanban-list { padding:10px; overflow-y:auto; flex:1; min-height:60px; }
.kanban-list.dragover { background:var(--accent-light); }
.kanban-card { background:var(--white); border:1px solid var(--border); border-radius:10px; padding:12px; margin-bottom:10px; box-shadow:var(--shadow); cursor:grab; transition:var(--transition); }
.kanban-card:hover { border-color:var(--accent-mid); box-shadow:var(--shadow-lg); }
.kanban-card.dragging { opacity:.45; }
.kanban-card-title { font-size:13px; font-weight:700; color:var(--dark); }
.kanban-card-sub { font-size:11px; color:var(--muted2); margin-top:2px; }
.kanban-chips { display:flex; gap:5px; margin-top:8px; flex-wrap:wrap; }
.kchip { font-size:10px; font-weight:700; padding:2px 7px; border-radius:20px; background:var(--off2); color:var(--muted); }
.kchip-q { background:var(--green-light); color:#15803d; }
.kchip-i { background:var(--blue-light); color:#1d4ed8; }
.kchip-low { background:var(--red-light); color:#991b1b; }
.kchip-val { background:var(--accent); color:#fff; }

/* card delete button (reveal on hover) */
.kcard-del { margin:-2px -2px 0 6px; }
.kcard-del-btn { border:none; background:none; color:var(--muted2); cursor:pointer; padding:0 2px; font-size:12px; opacity:0; transition:var(--transition); }
.kanban-card:hover .kcard-del-btn { opacity:1; }
.kcard-del-btn:hover { color:#dc2626; }

/* card status dots */
.kdot { display:inline-block; width:9px; height:9px; border-radius:50%; margin-right:4px; vertical-align:middle; }
.kdot-orange { background:#f59e0b; }
.kdot-green { background:#22c55e; }

/* stage column menu (rename/delete) */
.kanban-col-menu { position:relative; }
.kanban-col-menu > summary { list-style:none; cursor:pointer; }
.kanban-col-menu > summary::-webkit-details-marker { display:none; }
.kanban-col-pop { position:absolute; right:0; top:28px; z-index:30; width:230px; padding:10px;
  background:var(--white); border:1px solid var(--border); border-radius:var(--radius-lg); box-shadow:var(--shadow-lg); }

/* stage reorder grip */
.kanban-grip { cursor:grab; color:var(--muted2); display:inline-flex; }
.kanban-grip:active { cursor:grabbing; }
.kanban-col.dragging { opacity:.5; }

/* add-stage column */
.kanban-col-add { background:transparent; border:1px dashed var(--border); }
.kanban-col-add .kanban-col-head { color:var(--muted); }

/* ── Mobile ── */
.bm-burger { display:none; }
@media (max-width:900px){
  .bm-sidebar { transform:translateX(-100%); }
  .bm-sidebar.open { transform:translateX(0); }
  .bm-main { margin-left:0; }
  .bm-burger { display:inline-flex; }
}

/* ════════════════════════════════════════════════════════════════
   Bootstrap compatibility layer — restyle existing markup to match.
   (Pages not yet ported to bm- components still look modern.)
════════════════════════════════════════════════════════════════ */
/* Retint Bootstrap's blue "primary" to RevIQ teal everywhere
   (buttons, badges, bg-primary, text-primary, spinners, --bs-primary). */
:root { --bs-primary:#7c5cdb; --bs-primary-rgb:124,92,219; }
.bg-primary,.text-bg-primary { background-color:var(--accent)!important; }
.text-primary { color:var(--accent2)!important; }
.border-primary { border-color:var(--accent)!important; }
.btn-primary {
  --bs-btn-bg:var(--accent); --bs-btn-border-color:var(--accent);
  --bs-btn-hover-bg:var(--accent2); --bs-btn-hover-border-color:var(--accent2);
  --bs-btn-active-bg:var(--accent2); --bs-btn-active-border-color:var(--accent2);
  --bs-btn-disabled-bg:var(--accent); --bs-btn-disabled-border-color:var(--accent);
}
.btn-outline-primary {
  --bs-btn-color:var(--accent); --bs-btn-border-color:var(--accent);
  --bs-btn-hover-bg:var(--accent); --bs-btn-hover-border-color:var(--accent);
  --bs-btn-active-bg:var(--accent2); --bs-btn-active-border-color:var(--accent2);
}
.spinner-border.text-primary,.spinner-border-sm.text-primary { color:var(--accent)!important; }

.card { border:1px solid var(--border)!important; border-radius:var(--radius-lg)!important; box-shadow:var(--shadow); }
.card-body { padding:20px 22px; }
/* Match bm-btn sizing so Bootstrap buttons line up with bm- buttons. */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:40px; border-radius:8px; font-weight:600; font-size:14px; }
.btn-sm { min-height:32px; font-size:12.5px; }
.btn-lg { min-height:48px; font-size:16px; }
.btn-brand,.btn-primary { background:var(--accent)!important; border-color:var(--accent)!important; color:#fff!important; }
.btn-brand:hover,.btn-primary:hover { background:var(--accent2)!important; }
.btn-outline-secondary { border-color:var(--border2); color:var(--dark); }
.text-brand { color:var(--accent)!important; }
.bg-brand { background:var(--accent)!important; }
.border-brand { border-color:var(--accent)!important; }
.table thead.table-light th, .table thead th { background:var(--off); color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.06em; }
.badge { border-radius:20px; font-weight:600; }
.form-control,.form-select { border-radius:9px; border-color:var(--border2); font-size:15px; padding:11px 14px; }
.form-control:focus,.form-select:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-light); }
.form-label { font-size:14px; font-weight:600; color:var(--dark); margin-bottom:6px; }
.form-text { font-size:12.5px; }
textarea.form-control { min-height:auto; }
.alert { border-radius:10px; }
.progress { background:var(--off2); border-radius:20px; }
.progress-bar.bg-brand,.progress-bar { background:var(--accent); }
.list-group-item { border-color:var(--border); }
.nav-tabs .nav-link.active { color:var(--accent); border-bottom-color:var(--accent); }
.nav-tabs .nav-link { color:var(--muted); }

/* ════════════════════════════════════════════════════════════════
   RevIQ chat
════════════════════════════════════════════════════════════════ */
.reviq-shell { display:grid; grid-template-columns:264px 1fr; gap:16px; height:calc(100vh - var(--header-h) - 56px); }
@media (max-width:900px){ .reviq-shell{ grid-template-columns:1fr; height:auto; } .reviq-rail{ display:none; } }

.reviq-rail { background:var(--white); border:1px solid var(--border); border-radius:var(--radius-lg); display:flex; flex-direction:column; overflow:hidden; box-shadow:var(--shadow); }
.reviq-rail-head { padding:12px; border-bottom:1px solid var(--border); }
.reviq-convos { overflow-y:auto; padding:8px; flex:1; }
.reviq-convo { display:flex; align-items:center; gap:8px; padding:9px 10px; border-radius:10px; color:var(--muted); font-size:13px; cursor:pointer; text-decoration:none; margin-bottom:2px; }
.reviq-convo:hover { background:var(--off2); color:var(--dark); text-decoration:none; }
.reviq-convo.active { background:var(--accent-light); color:var(--accent2); font-weight:600; }
.reviq-convo .t { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.reviq-convo .del { border:none; background:none; padding:0; color:var(--muted2); opacity:0; cursor:pointer; transition:var(--transition); }
.reviq-convo:hover .del { opacity:1; }
.reviq-convo .del:hover { color:var(--red); }

.reviq-chat { background:var(--white); border:1px solid var(--border); border-radius:var(--radius-lg); display:flex; flex-direction:column; overflow:hidden; box-shadow:var(--shadow); min-height:520px; }
.reviq-thread { flex:1; overflow-y:auto; padding:24px clamp(16px,6%,72px); display:flex; flex-direction:column; gap:16px; }
.reviq-row { display:flex; gap:12px; align-items:flex-start; max-width:780px; }
.reviq-row.user { align-self:flex-end; flex-direction:row-reverse; }
.reviq-row.bot { align-self:flex-start; }
.reviq-av { width:30px; height:30px; border-radius:9px; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-weight:800; font-size:12px; }
.reviq-av.bot { background:linear-gradient(135deg,var(--accent),var(--accent2)); color:#fff; }
.reviq-av.me { background:var(--off2); color:var(--muted); }
.reviq-bubble { padding:11px 15px; border-radius:16px; font-size:14px; line-height:1.6; white-space:pre-wrap; word-wrap:break-word; }
.reviq-row.bot .reviq-bubble { background:var(--off); border:1px solid var(--border); border-top-left-radius:5px; color:var(--dark); }
.reviq-row.user .reviq-bubble { background:var(--accent); color:#fff; border-top-right-radius:5px; }

.reviq-empty { margin:auto; text-align:center; max-width:540px; color:var(--muted); padding:20px; }
.reviq-empty .mark { width:56px; height:56px; border-radius:16px; margin:0 auto 16px; display:flex; align-items:center; justify-content:center; color:#fff; font-weight:800; font-size:22px; background:linear-gradient(135deg,var(--accent),var(--accent2)); box-shadow:var(--shadow); }
.reviq-empty h2 { font-size:19px; color:var(--dark); margin:0 0 6px; }
.reviq-chips { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin-top:18px; }
.reviq-chip { padding:8px 13px; border:1px solid var(--border2); border-radius:20px; font-size:12.5px; color:var(--dark); background:var(--white); cursor:pointer; transition:var(--transition); }
.reviq-chip:hover { border-color:var(--accent-mid); background:var(--accent-light); color:var(--accent2); }

.reviq-composer { border-top:1px solid var(--border); padding:14px clamp(16px,6%,72px) 16px; background:var(--white); }
.reviq-inputwrap { display:flex; align-items:flex-end; gap:8px; border:1px solid var(--border2); border-radius:16px; padding:7px 7px 7px 15px; background:var(--white); transition:var(--transition); }
.reviq-inputwrap:focus-within { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-light); }
.reviq-inputwrap textarea { flex:1; border:none; outline:none; resize:none; font-family:inherit; font-size:14px; line-height:1.5; max-height:168px; background:transparent; color:var(--dark); padding:6px 0; }
.reviq-sendbtn { width:38px; height:38px; border-radius:12px; border:none; background:var(--accent); color:#fff; display:flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0; transition:var(--transition); }
.reviq-sendbtn:hover { background:var(--accent2); }
.reviq-sendbtn:disabled { opacity:.45; cursor:default; }
.reviq-hint { font-size:11px; color:var(--muted2); text-align:center; margin-top:7px; }

.reviq-typing { display:inline-flex; gap:4px; padding:5px 2px; }
.reviq-typing span { width:7px; height:7px; border-radius:50%; background:var(--muted2); animation:reviqdot 1.2s infinite ease-in-out; }
.reviq-typing span:nth-child(2){ animation-delay:.2s; }
.reviq-typing span:nth-child(3){ animation-delay:.4s; }
@keyframes reviqdot { 0%,60%,100%{ transform:translateY(0); opacity:.4; } 30%{ transform:translateY(-4px); opacity:1; } }

/* ════════════════════════════════════════════════════════════════
   Whiteboard (freeform sticky canvas)
════════════════════════════════════════════════════════════════ */
.wb-toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
.wb-toggle { display:inline-flex; background:var(--off2); border:1px solid var(--border); border-radius:20px; padding:3px; }
.wb-toggle a { padding:5px 14px; border-radius:18px; font-size:13px; font-weight:600; color:var(--muted); text-decoration:none; }
.wb-toggle a.active { background:var(--white); color:var(--accent2); box-shadow:var(--shadow); }
.wb-swatch { width:22px; height:22px; border-radius:6px; border:2px solid transparent; cursor:pointer; }
.wb-swatch.active { border-color:var(--dark); }

.wb-canvas { position:relative; height:calc(100vh - var(--header-h) - 150px); min-height:480px;
  border:1px solid var(--border); border-radius:var(--radius-lg); overflow:auto; background:var(--white);
  background-image:radial-gradient(var(--border) 1px, transparent 1px); background-size:22px 22px; }

.wb-note { position:absolute; width:210px; min-height:120px; border-radius:10px; padding:8px 10px 10px;
  box-shadow:var(--shadow); display:flex; flex-direction:column; gap:4px; border:1px solid rgba(0,0,0,.06); }
.wb-note .wb-grip { cursor:grab; display:flex; justify-content:space-between; align-items:center; font-size:11px; color:rgba(0,0,0,.45); }
.wb-note .wb-grip:active { cursor:grabbing; }
.wb-note textarea { border:none; background:transparent; resize:none; outline:none; font-family:inherit;
  font-size:13px; line-height:1.45; color:#1f2937; flex:1; min-height:60px; }
.wb-note .wb-foot { display:flex; align-items:center; gap:6px; font-size:11px; }
.wb-note .wb-foot select { font-size:11px; border:none; background:rgba(255,255,255,.5); border-radius:6px; max-width:120px; }
.wb-note .wb-act { border:none; background:none; cursor:pointer; color:rgba(0,0,0,.5); padding:0 2px; }
.wb-note .wb-act:hover { color:#111; }
.wb-c-yellow{ background:#fef9c3; } .wb-c-green{ background:#dcfce7; } .wb-c-blue{ background:#dbeafe; }
.wb-c-pink{ background:#fce7f3; } .wb-c-teal{ background:#e9f4f1; } .wb-c-gray{ background:#eef2f1; }
.wb-empty { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); text-align:center;
  color:var(--muted2); font-size:14px; pointer-events:none; }
.wb-note.dragging { box-shadow:var(--shadow-lg); }

/* ════════════════════════════════════════════════════════════════
   Performance racing track (gamified leaderboard)
════════════════════════════════════════════════════════════════ */
.race { background:linear-gradient(180deg,#26312b,#1d2620); border-radius:var(--radius-lg);
  padding:16px 14px; position:relative; box-shadow:var(--shadow); }
.race-lane { position:relative; height:48px; border-bottom:2px dashed rgba(255,255,255,.10); }
.race-lane:last-child { border-bottom:none; }
.race-finish { position:absolute; right:6px; top:6px; bottom:6px; width:12px; border-radius:2px;
  background:repeating-linear-gradient(45deg,#fff 0 5px,#1d2620 5px 10px); opacity:.55; }
.race-rankno { position:absolute; left:6px; top:50%; transform:translateY(-50%);
  font-size:11px; font-weight:800; color:rgba(255,255,255,.4); width:20px; text-align:center; }
.race-car { position:absolute; top:50%; transform:translateY(-50%); left:6px;
  transition:left 1.2s cubic-bezier(.22,1,.36,1); display:flex; align-items:center; gap:6px; white-space:nowrap; }
.race-car .car { font-size:20px; filter:drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
.race-car .tag { display:inline-flex; align-items:center; gap:6px; padding:3px 9px; border-radius:20px;
  font-size:12px; font-weight:700; color:#fff; box-shadow:0 2px 6px rgba(0,0,0,.3); }
.race-car .pts { font-weight:800; }
.race-you { outline:2px solid rgba(255,255,255,.6); outline-offset:2px; border-radius:20px; }
.race-medal { font-size:14px; }

.lb-rank { font-weight:800; color:var(--muted); width:30px; }
.lb-dot { width:12px; height:12px; border-radius:50%; display:inline-block; }

/* ════════════════════════════════════════════════════════════════
   PySquad CoC — platform-specific components
════════════════════════════════════════════════════════════════ */
/* Auth screens */
.auth-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px;
  background:radial-gradient(1200px 600px at 20% -10%, var(--accent-light), transparent),
             radial-gradient(1000px 500px at 110% 110%, #fbeffb, transparent), var(--off); }
.auth-card { width:100%; max-width:420px; background:var(--white); border:1px solid var(--border);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-lg); padding:34px 32px; }
.auth-logo { display:flex; align-items:center; gap:10px; margin-bottom:22px; }
.auth-logo img { height:34px; }
.auth-brand { font-size:20px; font-weight:800; color:var(--dark); letter-spacing:.01em; }
.auth-brand span { color:var(--accent); }
.auth-title { font-size:19px; font-weight:700; color:var(--dark); margin:0 0 4px; }
.auth-sub { font-size:13px; color:var(--muted); margin-bottom:22px; }
.auth-alt { text-align:center; font-size:13px; color:var(--muted); margin-top:18px; }

/* Pipeline status pills */
.st-pill { display:inline-flex; align-items:center; gap:5px; padding:3px 10px; border-radius:20px;
  font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.st-planning       { background:var(--off2); color:var(--muted); }
.st-idea_approval  { background:var(--blue-light); color:#1d4ed8; }
.st-design         { background:#fef3c7; color:#92400e; }
.st-content_approval { background:#ede9fe; color:#6d28d9; }
.st-scheduling     { background:#cffafe; color:#0e7490; }
.st-scheduled      { background:#c7d2fe; color:#3730a3; }
.st-ready_to_post  { background:#dcfce7; color:#15803d; }
.st-done           { background:var(--accent-light); color:var(--accent2); }
.st-hold           { background:#ffedd5; color:#c2410c; }
.st-archived       { background:#f1f5f9; color:#64748b; }

/* Dashboard post calendar */
.cal-grid { display:grid; grid-template-columns:repeat(7,minmax(96px,1fr)); gap:6px; }
.cal-head { margin-bottom:6px; }
.cal-wd { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.05em;
  color:var(--muted); text-align:center; padding:2px 0; }
.cal-grid + .cal-grid { margin-top:6px; }
.cal-cell { min-height:78px; border:1px solid var(--border,#e5e7eb); border-radius:8px;
  padding:5px 6px; background:var(--off,#fafafa); display:flex; flex-direction:column; gap:3px; }
.cal-empty { background:transparent; border:1px dashed transparent; }
/* Delay dashboard rows — title + a single due/overdue badge, stacked & clickable */
.delay-head { font-size:11px; font-weight:700; color:var(--muted); text-transform:uppercase;
  letter-spacing:.06em; margin:12px 0 4px; }
.delay-head:first-of-type { margin-top:2px; }
.delay-row { display:flex; align-items:center; justify-content:space-between; gap:8px;
  padding:8px 0; border-bottom:1px solid var(--border); text-decoration:none; color:inherit; }
.delay-row:last-child { border-bottom:none; }
.delay-row:hover { background:var(--off2); }
.delay-title { font-size:13px; font-weight:600; color:var(--dark); line-height:1.3;
  overflow:hidden; text-overflow:ellipsis; display:-webkit-box; -webkit-line-clamp:2;
  -webkit-box-orient:vertical; }
.delay-row .overdue-badge, .delay-row .bm-badge { flex:0 0 auto; white-space:nowrap; }
.delay-none { color:var(--muted); font-size:12.5px; margin:2px 0 0; }

.cal-wrap { overflow-x:hidden; }
/* Week view has a single row — let cells grow to fill the vertical space */
.cal-week .cal-cell { min-height:220px; }
.cal-today { border-color:var(--accent2,#7c3aed); box-shadow:0 0 0 1px var(--accent2,#7c3aed) inset; }
.cal-day { font-size:11px; font-weight:700; color:var(--muted); }
.cal-item { display:block; font-size:11px; font-weight:600; padding:2px 6px; border-radius:5px;
  text-decoration:none; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cal-entry { display:block; font-size:11px; color:var(--muted); text-decoration:none;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cal-entry:hover, .cal-item:hover { opacity:.85; }

/* Pipeline rail on detail page */
.pipe-rail { display:flex; gap:6px; flex-wrap:wrap; margin:6px 0 4px; }
.pipe-step { display:flex; align-items:center; gap:6px; padding:6px 12px; border-radius:20px;
  font-size:11.5px; font-weight:600; background:var(--off2); color:var(--muted2); }
.pipe-step.done { background:var(--accent-light); color:var(--accent2); }
.pipe-step.current { background:var(--accent); color:#fff; box-shadow:0 3px 10px rgba(124,92,219,.3); }

/* Version blocks */
.ver-card { border:1px solid var(--border); border-radius:var(--radius); padding:14px 16px; background:var(--white); margin-bottom:12px; }
.ver-card.current { border-color:var(--accent-mid); box-shadow:0 0 0 2px var(--accent-light) inset; }
.ver-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.ver-badge { font-size:11px; font-weight:700; color:var(--accent2); background:var(--accent-light); padding:2px 8px; border-radius:6px; }
.script-block { white-space:pre-wrap; font-size:13px; line-height:1.6; color:var(--dark); background:var(--off);
  border:1px solid var(--border); border-radius:10px; padding:14px; max-height:420px; overflow:auto; }

/* Visual file thumbs */
.vfile-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:10px; }
.vfile { border:1px solid var(--border); border-radius:10px; overflow:hidden; background:var(--off); }
.vfile img { width:100%; height:110px; object-fit:cover; display:block; }
.vfile .cap { padding:6px 8px; font-size:11px; color:var(--muted); display:flex; justify-content:space-between; }

/* AI generation progress */
.gen-steps { display:flex; flex-direction:column; gap:10px; margin:16px 0; }
.gen-step { display:flex; align-items:center; gap:12px; padding:12px 14px; border-radius:12px; border:1px solid var(--border); background:var(--white); }
.gen-step .dot { width:26px; height:26px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  background:var(--off2); color:var(--muted2); font-size:13px; flex-shrink:0; }
.gen-step.active { border-color:var(--accent-mid); background:var(--accent-light); }
.gen-step.active .dot { background:var(--accent); color:#fff; animation:pulse 1.2s infinite; }
.gen-step.done .dot { background:var(--green); color:#fff; }
.gen-step .lbl { font-size:13px; font-weight:600; color:var(--dark); }
@keyframes pulse { 0%,100%{ box-shadow:0 0 0 0 rgba(124,92,219,.4);} 50%{ box-shadow:0 0 0 6px rgba(124,92,219,0);} }

/* Related content / duplicate flags */
.dup-flag { border-radius:12px; padding:12px 14px; font-size:13px; margin-bottom:12px; border:1px solid; }
.dup-clear { background:var(--green-light); border-color:#bbf7d0; color:#166534; }
.dup-related { background:var(--amber-light); border-color:#fde68a; color:#92400e; }
.dup-duplicate { background:var(--red-light); border-color:#fecaca; color:#991b1b; }
.rel-item { display:flex; justify-content:space-between; gap:10px; padding:7px 0; border-bottom:1px dashed var(--border); font-size:12.5px; }
.rel-item:last-child { border-bottom:none; }
.rel-score { font-weight:700; color:var(--accent2); }

/* Calendar */
#calendar { background:var(--white); border:1px solid var(--border); border-radius:var(--radius-lg); padding:16px; box-shadow:var(--shadow); }
.cal-legend { display:flex; gap:14px; flex-wrap:wrap; margin-bottom:12px; }
.cal-legend span { display:inline-flex; align-items:center; gap:6px; font-size:12px; color:var(--muted); }
.cal-dot { width:10px; height:10px; border-radius:3px; display:inline-block; }

/* Notifications dropdown */
.notif-wrap { position:relative; }
.notif-btn { position:relative; }
.notif-count { position:absolute; top:-4px; right:-4px; background:var(--red); color:#fff; font-size:10px;
  font-weight:700; min-width:17px; height:17px; border-radius:20px; display:flex; align-items:center; justify-content:center; padding:0 4px; }
.notif-pop { position:absolute; right:0; top:44px; width:360px; max-height:440px; overflow-y:auto; z-index:200;
  background:var(--white); border:1px solid var(--border); border-radius:var(--radius-lg); box-shadow:var(--shadow-lg); padding:8px; }
.notif-item { display:flex; gap:10px; padding:10px; border-radius:10px; }
.notif-item.unread { background:var(--accent-light); }
.notif-item:hover { background:var(--off2); }
.notif-ic { width:30px; height:30px; border-radius:8px; background:var(--accent-light); color:var(--accent);
  display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.notif-txt { font-size:12.5px; color:var(--dark); }
.notif-time { font-size:11px; color:var(--muted2); margin-top:2px; }

/* Empty state */
.empty-state { text-align:center; padding:56px 20px; color:var(--muted); }
.empty-state .ic { width:60px; height:60px; border-radius:16px; margin:0 auto 16px; display:flex; align-items:center;
  justify-content:center; font-size:26px; background:var(--accent-light); color:var(--accent); }
.empty-state h3 { font-size:17px; color:var(--dark); margin:0 0 6px; }
.empty-state p { font-size:13px; margin:0 0 18px; }

/* KPI delta */
.kpi-row { display:flex; gap:14px; flex-wrap:wrap; }
.overdue-badge { background:var(--red); color:#fff; border-radius:20px; padding:1px 8px; font-size:10px; font-weight:700; }

/* Workspace picker cards */
.ws-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:16px; }
.ws-card { display:block; border:1px solid var(--border); border-radius:var(--radius-lg); padding:20px; background:var(--white);
  box-shadow:var(--shadow); transition:var(--transition); }
.ws-card:hover { border-color:var(--accent-mid); box-shadow:var(--shadow-lg); text-decoration:none; transform:translateY(-2px); }
.ws-mark { width:44px; height:44px; border-radius:12px; background:linear-gradient(135deg,var(--accent),var(--accent2));
  color:#fff; display:flex; align-items:center; justify-content:center; font-weight:800; font-size:18px; margin-bottom:12px; }

/* AI Studio text editor */
.ed-toolbar { display:flex; align-items:center; gap:6px; padding:8px; border:1px solid var(--border2);
  border-bottom:none; border-radius:9px 9px 0 0; background:var(--off); }
.ed-tool { width:30px; height:28px; border:1px solid var(--border2); background:var(--white); border-radius:6px;
  font-weight:700; font-size:13px; color:var(--dark); cursor:pointer; display:inline-flex; align-items:center; justify-content:center; }
.ed-tool:hover { background:var(--accent-light); border-color:var(--accent-mid); color:var(--accent2); }
.ed-area { width:100%; min-height:360px; border:1px solid var(--border2); border-radius:0 0 9px 9px;
  padding:16px; font-family:'SFMono-Regular',ui-monospace,Menlo,Consolas,monospace; font-size:13px; line-height:1.65;
  color:var(--dark); background:var(--white); resize:vertical; }
.ed-area:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-light); }
