/* ============================================================
   IT Business Partnership — Custom Design System
   ============================================================ */

/* ---- Variables ------------------------------------------- */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface2: #f0f0f2;
  --border: #d8d9dc;
  --border2: #97999b;
  --accent: #72246c;
  --brand-purple: #72246c;
  --accent-light: #f4edf4;
  --green: #48a23f;
  --green-light: #eef7ed;
  --amber: #f0b323;
  --amber-light: #fff8e6;
  --red: #dc6b2f;
  --red-light: #fdf1ea;
  --purple: #72246c;
  --purple-light: #f4edf4;
  --cyan: #41b6e6;
  --cyan-light: #ecf8fd;
  --text: #1e2028;
  --text2: #3a3d47;
  --muted: #626a76;
  --muted2: #97999b;
  --dynamic-yellow: #f0b323;
  --dynamic-blue: #41b6e6;
  --dynamic-green: #48a23f;
  --influential-orange: #dc6b2f;
  --influential-blue: #3a5dae;
  --influential-green: #00857d;
  --grad-purple: linear-gradient(to top right, #672D89 20%, #72246c 70%, #c2188b 100%);
  --grad-blue: linear-gradient(to top right, #3a5dae 0%, #41b6e6 100%);
  --grad-orange: linear-gradient(to top right, #dc6b2f 0%, #f0b323 100%);
  --grad-green: linear-gradient(to top right, #00857d 0%, #48a23f 100%);
  --sidebar-w: 220px;
  --sidebar-bg: #72246c;
  --header-h: 62px;
  --card-radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.03);
  --shadow-lg: 0 4px 16px rgba(0,0,0,.07), 0 1px 3px rgba(0,0,0,.04);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --teal: #0D9488;
  --teal-light: #CCFBF1;
  --id-link: #E11D74;
  --table-header-color: #6B7280;
  --table-row-hover: rgba(0,0,0,.03);
}

/* ---- Dark Mode ------------------------------------------- */
[data-theme="dark"] {
  --bg: #141518;
  --surface: #1e2024;
  --surface2: #26282d;
  --border: #333640;
  --border2: #4a4d56;
  --text: #e8eaee;
  --text2: #c4c8d0;
  --muted: #8a8f9c;
  --muted2: #636874;
  --accent-light: #2d1f2d;
  --green-light: #0e2010;
  --amber-light: #291e00;
  --red-light: #2a1200;
  --cyan-light: #0b1e29;
  --purple-light: #2a1a2a;
  --shadow: 0 1px 3px rgba(0,0,0,.35), 0 1px 2px rgba(0,0,0,.25);
  --shadow-lg: 0 4px 16px rgba(0,0,0,.45), 0 1px 3px rgba(0,0,0,.3);
  --teal-light: #042f2e;
  --id-link: #FB7185;
  --table-header-color: #9ca3af;
  --table-row-hover: rgba(255,255,255,.04);
}

[data-theme="dark"] .header {
  background: rgba(20,21,24,.92);
  border-bottom-color: var(--border);
}

/* ---- Reset ----------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; overflow: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Header ---------------------------------------------- */
.header {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: fixed;
  top: 0; left: var(--sidebar-w); right: 0;
  z-index: 150;
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
}

.brand-icon {
  width: 34px; height: 34px;
  background: var(--grad-purple);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #fff;
  box-shadow: 0 2px 8px rgba(114,36,108,.35);
}
.brand-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.brand-name { font-size: 14px; font-weight: 700; color: #fff; letter-spacing: -.2px; line-height: 1.2; }
.brand-sub  { font-size: 10px; color: rgba(255,255,255,.5); font-weight: 500; letter-spacing: .6px; text-transform: uppercase; }
.brand-text { transition: opacity .2s, width .2s; overflow: hidden; white-space: nowrap; }

.header-mid  { flex: 1; padding: 0 8px; }
.header-title { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -.3px; }
.header-sub   { font-size: 11px; color: var(--muted); font-weight: 500; }

.header-right { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

/* User profile pill */
.user-pill {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 5px 10px 5px 6px;
  border-radius: 20px;
}
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
  letter-spacing: .5px;
}
.user-name {
  font-size: 12.5px; font-weight: 600; color: var(--text);
  white-space: nowrap;
}
.user-logout {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  color: var(--muted);
  border-radius: 6px;
  text-decoration: none;
  transition: color .15s, background .15s;
  margin-left: 2px;
}
.user-logout svg { width: 14px; height: 14px; }
.user-logout:hover { color: var(--accent); background: var(--surface2); }

/* ---- Layout ---------------------------------------------- */
.layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---- Sidebar --------------------------------------------- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  background-image: linear-gradient(180deg, #72246c 0%, #5a1c55 100%);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow: hidden;
  z-index: 200;
  display: flex; flex-direction: column;
  transition: width .25s cubic-bezier(.4,0,.2,1);
}

/* Sidebar section label */
.sl {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: rgba(255,255,255,.35);
  padding: 12px 12px 6px;
  margin-top: 8px;
  white-space: nowrap; overflow: hidden;
  transition: opacity .2s;
}
.sl:first-child { margin-top: 0; }

/* Nav item */
.ni {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
  color: rgba(255,255,255,.72);
  font-size: 13px; font-weight: 500;
  transition: all .15s;
  border: none; background: none;
  width: 100%; text-align: left;
  font-family: var(--font);
  white-space: nowrap; overflow: hidden;
  text-decoration: none;
}
.ni:hover  { background: rgba(255,255,255,.1); color: #fff; }
.ni.active { background: rgba(255,255,255,.18); color: #fff; font-weight: 600; }

.ni-icon {
  width: 20px; height: 20px; min-width: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: rgba(255,255,255,.5);
}
.ni-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ni:hover  .ni-icon { color: rgba(255,255,255,.85); }
.ni.active .ni-icon { color: #fff; }

.ni-cnt {
  margin-left: auto;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.6);
  font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 6px;
  font-family: var(--font);
  flex-shrink: 0;
  transition: opacity .2s;
}
.ni.active .ni-cnt { background: rgba(255,255,255,.2); color: #fff; }
.ni-text { transition: opacity .2s; overflow: hidden; }

/* Sidebar brand section at top */
.sidebar-brand {
  height: var(--header-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}

/* Sidebar nav scroll area */
.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 10px; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

/* Sidebar user section at bottom */
.sidebar-user {
  padding: 12px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; overflow: hidden; min-width: 0; }
.sidebar-user-name { font-size: 12.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 10px; color: rgba(255,255,255,.45); text-transform: capitalize; }
.sidebar-logout {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; flex-shrink: 0;
  color: rgba(255,255,255,.4);
  border-radius: 7px;
  text-decoration: none;
  transition: color .15s, background .15s;
}
.sidebar-logout svg { width: 15px; height: 15px; }
.sidebar-logout:hover { color: #fff; background: rgba(255,255,255,.12); }

/* ---- Content Area ---------------------------------------- */
.content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 28px 32px;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ---- Collapsible Nav Groups ------------------------------ */
.ni-group { margin-top: 1px; }
.ni-group-hdr { background: none; border: none; cursor: pointer; font-family: var(--font); }

.ni-chevron {
  margin-left: auto; flex-shrink: 0;
  width: 15px; height: 15px;
  opacity: .45;
  transition: transform .22s cubic-bezier(.4,0,.2,1), opacity .2s;
}
.ni-chevron svg { width: 15px; height: 15px; display: block; }
.ni-group.open > .ni-group-hdr .ni-chevron { transform: rotate(180deg); opacity: .7; }
.ni-group.open > .ni-group-hdr { color: #fff; }
.ni-group.open > .ni-group-hdr .ni-icon { color: rgba(255,255,255,.85); }

.ni-group-items {
  overflow: hidden; max-height: 0;
  transition: max-height .28s cubic-bezier(.4,0,.2,1);
  padding-left: 0;
  margin: 0 0 4px 22px;
  border-left: 1.5px solid rgba(255,255,255,.14);
}
.ni-group.open .ni-group-items { max-height: 300px; }

.ni-sub {
  padding: 7px 10px 7px 18px;
  font-size: 13px;
  font-weight: 400;
  color: rgba(255,255,255,.6);
  border-radius: 7px;
  white-space: nowrap; overflow: hidden;
}
.ni-sub:hover { color: rgba(255,255,255,.92); background: rgba(255,255,255,.09); }
.ni-sub.active { color: #fff; font-weight: 600; background: rgba(255,255,255,.16); }

/* ---- Section Header -------------------------------------- */
.sec-hdr { margin-bottom: 24px; }
.sec-hdr.with-action {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.sec-hdr h2 { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.5px; }
.sec-hdr p  { font-size: 13px; color: var(--muted); margin-top: 3px; font-weight: 400; }

.sec-hdr-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.entity-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  padding: 8px 13px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(114,36,108,.18);
  transition: background .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.entity-add-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
}
.entity-add-btn:hover,
.entity-add-btn:focus {
  background: #5e1d59;
  border-color: #5e1d59;
  color: #fff;
  box-shadow: 0 4px 12px rgba(114,36,108,.26);
  transform: translateY(-1px);
}
.entity-add-btn:focus { outline: none; }

/* ---- Grids ----------------------------------------------- */
.g2  { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 18px; }
.g3  { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.g4  { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.g5  { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.gaf { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 14px; margin-bottom: 18px; }
.mb-3 { margin-bottom: 18px; }

/* ---- Card ------------------------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-mb { margin-bottom: 18px; }
.ct { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .9px; color: var(--muted); margin-bottom: 14px; }

/* ---- Badges ---------------------------------------------- */
.b  { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; letter-spacing: .1px; line-height: 1.4; }
.b.bg, .b.gr { background: var(--teal);          color: #fff; }
.b.ba, .b.am { background: var(--amber-light);   color: #92400e; }
.b.br, .b.re { background: var(--red-light);     color: #991b1b; }
.b.bb, .b.bl { background: var(--accent-light);  color: #3730a3; }
.b.bp, .b.pu { background: var(--purple-light);  color: #6d28d9; }
.b.bc        { background: var(--cyan-light);    color: #0e7490; }
.b.bx        { background: transparent;         color: var(--muted); padding-left: 0; padding-right: 0; }
[data-theme="dark"] .b.bg,
[data-theme="dark"] .b.gr { background: #134e4a; color: #5eead4; }
[data-theme="dark"] .b.bx { color: var(--muted); }

/* ---- Table ----------------------------------------------- */
.tw { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

thead { position: sticky; top: 0; z-index: 2; }
th {
  background: transparent;
  color: var(--table-header-color);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .8px;
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
[data-theme="dark"] th {
  background: transparent;
  color: var(--table-header-color);
  border-bottom-color: var(--border);
}

td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
  vertical-align: middle;
  line-height: 1.45;
}
tr:last-child td { border-bottom: none; }

tbody tr { transition: background .1s; }
tbody tr:hover td { background: var(--table-row-hover); }
tbody tr.clickable-row,
tbody tr.clickable-row td { cursor: pointer; }

/* Empty state */
.empty-cell { text-align: center; padding: 0 !important; }
.empty-state {
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.empty-state p { font-size: 13px; margin: 0; color: var(--muted); }
.empty-state svg { opacity: .3; }

/* Skeleton loading shimmer */
@keyframes skel-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skel-line {
  height: 13px; border-radius: 5px;
  background: linear-gradient(90deg,
    var(--surface2) 25%, var(--border) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.4s infinite;
}
.app-loading-state {
  min-height: 150px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--surface), var(--surface2));
  color: var(--text2);
}
.app-loading-spinner {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: app-loading-spin .75s linear infinite;
}
.app-loading-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.app-loading-copy strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}
.app-loading-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.app-loading-state-error {
  border-style: solid;
  background: var(--red-light);
}
.app-page-loader {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 1600;
  min-width: 190px;
  overflow: hidden;
  transform: translate(-50%, -14px);
  opacity: 0;
  pointer-events: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  transition: opacity .16s ease, transform .16s ease;
}
.app-page-loader.active {
  opacity: 1;
  transform: translate(-50%, 0);
}
.app-page-loader-bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 3px;
  width: 48%;
  border-radius: 999px;
  background: var(--accent);
  animation: app-page-loader-bar 1s ease-in-out infinite;
}
.app-page-loader-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 18px 10px;
  font-size: 12px;
  font-weight: 800;
}
.app-page-loader-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: app-loading-spin .75s linear infinite;
}
.bp-loading-cell {
  padding: 18px !important;
  background: var(--surface) !important;
}
.bp-kpi-card-loading {
  cursor: default;
}
.bp-conv-card-loading {
  min-height: 176px;
  pointer-events: none;
}
@keyframes app-loading-spin {
  to { transform: rotate(360deg); }
}
@keyframes app-page-loader-bar {
  0% { transform: translateX(-110%); }
  50% { transform: translateX(85%); }
  100% { transform: translateX(230%); }
}

/* ---- Table pagination ------------------------------------ */
.pager-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.pager-row:empty { display: none; }
.pager-info {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.pager-row .pager-btn {
  width: 32px;
  min-width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
  transform: none;
}
.pager-row .pager-btn.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(114,36,108,.22);
}
.pager-row .pager-btn.btn-outline-secondary {
  background: var(--surface);
  border-color: var(--border2);
  color: var(--text2);
}
.pager-row .pager-btn:hover,
.pager-row .pager-btn:focus { transform: none; }
.pager-row .pager-btn.btn-outline-secondary:hover,
.pager-row .pager-btn.btn-outline-secondary:focus {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.table-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}
.table-action-btn {
  width: auto;
  min-width: 56px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.table-action-btn:hover,
.table-action-btn:focus {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 2px 8px rgba(114,36,108,.12);
  outline: none;
}

/* ---- Entity modals / drawers ----------------------------- */
body.modal-open { overflow: hidden; }
.edit-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(30,32,40,.55);
}
.edit-modal-overlay.open { display: flex; }
.edit-modal {
  position: relative;
  width: min(900px, calc(100vw - 48px));
  max-height: min(90vh, 900px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.28);
  padding: 0;
  animation: entityPopupIn .16s ease-out;
}
@keyframes entityPopupIn {
  from { transform: scale(.97) translateY(8px); opacity: .8; }
  to   { transform: scale(1)   translateY(0);   opacity: 1; }
}
.edit-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.edit-modal-close:hover { border-color: var(--accent); color: var(--accent); }
.edit-modal-header { margin: 0 40px 18px 0; }
.edit-eyebrow {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
}
.edit-modal h3 {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.3px;
}
.edit-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
}
.edit-field.full { grid-column: 1 / -1; }
.edit-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.edit-field input,
.edit-field select,
.edit-field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 9px 11px;
  transition: border-color .15s, box-shadow .15s;
}
.edit-field textarea { resize: vertical; min-height: 92px; }
.edit-field input:focus,
.edit-field select:focus,
.edit-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(114,36,108,.1);
  outline: none;
}
.bp-combo {
  position: relative;
}
.bp-combo::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  pointer-events: none;
  transform: translateY(-65%) rotate(45deg);
}
.bp-combo-input {
  padding-right: 34px !important;
}
.bp-combo-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 5px);
  z-index: 560;
  max-height: 220px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 14px 30px rgba(0,0,0,.16), 0 2px 8px rgba(0,0,0,.08);
}
.bp-combo-menu[hidden] {
  display: none;
}
.bp-combo-option {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}
.bp-combo-option:hover,
.bp-combo-option:focus {
  background: var(--accent-light);
  color: var(--accent);
  outline: none;
}
.edit-message {
  min-height: 20px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: -24px;
  background: var(--surface);
  padding-bottom: 2px;
}
.edit-btn {
  width: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.edit-btn.secondary { background: var(--surface); color: var(--text2); }
.edit-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(114,36,108,.22);
}
.edit-btn:disabled { cursor: wait; opacity: .7; }

/* ---- Read-only detail items ------------------------------- */
.readonly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}
.readonly-item {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface2);
  padding: 10px 12px;
  min-width: 0;
}
.readonly-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .7px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.readonly-value {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.readonly-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.readonly-section h4 {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .2px;
  margin: 0 0 8px;
}
.readonly-section p,
.readonly-section li {
  color: var(--text2);
  font-size: 13px;
  line-height: 1.6;
}
.readonly-section p { margin: 0; white-space: pre-wrap; }
.readonly-section ul { margin: 0; padding-left: 18px; }
.readonly-muted {
  color: var(--muted);
  font-size: 12px;
  margin-left: 6px;
}
.readonly-table { margin: 0; font-size: 12px; }
.readonly-header { margin-bottom: 16px; }
.readonly-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* ---- Filter row ------------------------------------------ */
.filter-row,
.filters-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.filter-row > .form-select,
.filter-row > .form-control,
.filters-row > .form-select,
.filters-row > .form-control {
  flex: 1 1 180px;
  min-width: 160px;
}

/* Bootstrap form overrides to match design system */
.form-select,
.form-control {
  border-radius: 9px !important;
  border-color: var(--border) !important;
  font-size: 13px !important;
  color: var(--text2) !important;
}
.form-select:focus,
.form-control:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(114,36,108,.1) !important;
  outline: none !important;
}

/* ---- Login page ------------------------------------------ */
.auth-login-page { background: #fff; }
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(520px, 1fr);
  background: #fff;
}
.login-hero {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  padding: 72px 64px 58px;
  color: #fff;
  background:
    linear-gradient(155deg, rgba(255,255,255,.08) 0 22%, transparent 22% 100%),
    linear-gradient(135deg, #63338f 0%, #72246c 54%, #a91874 100%);
  display: flex;
  flex-direction: column;
}
.login-glow {
  position: absolute;
  top: -120px;
  right: -210px;
  width: 560px;
  height: 540px;
  background: rgba(168, 52, 135, .28);
  clip-path: polygon(18% 0, 100% 0, 100% 82%, 52% 100%, 0 58%);
}
.login-brand-lockup {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
}
.login-logo-mark {
  position: relative;
  width: 42px;
  height: 54px;
  flex: 0 0 auto;
}
.login-logo-mark span {
  position: absolute;
  display: block;
  width: 26px;
  height: 26px;
  background: rgba(255,255,255,.88);
}
.login-logo-mark span:nth-child(1) {
  top: 0;
  left: 12px;
  clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%);
}
.login-logo-mark span:nth-child(2) {
  top: 24px;
  left: 0;
  background: rgba(255,255,255,.56);
  clip-path: polygon(100% 0, 100% 100%, 0 50%);
}
.login-logo-mark span:nth-child(3) {
  top: 34px;
  left: 12px;
  background: rgba(255,255,255,.34);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.login-logo-name {
  color: #fff;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: .4px;
  line-height: 1;
}
.login-logo-sub {
  position: relative;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: .7px;
  line-height: 1.2;
}
.login-logo-sub::after {
  content: "";
  display: inline-block;
  width: 148px;
  height: 1px;
  margin-left: 12px;
  vertical-align: middle;
  background: rgba(255,255,255,.45);
}
.login-platform-name {
  position: relative;
  z-index: 1;
  margin-top: 24px;
  color: rgba(255,255,255,.72);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 2px;
}
.login-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin-top: auto;
  padding-bottom: 190px;
}
.login-hero-copy h1 {
  color: #fff;
  font-size: clamp(34px, 3.7vw, 52px);
  line-height: 1.22;
  font-weight: 400;
  letter-spacing: 0;
  margin: 0;
}
.login-hero-copy strong { display: block; font-weight: 900; }
.login-hero-line {
  width: 92px;
  height: 5px;
  margin: 40px 0 24px;
  border-radius: 999px;
  background: var(--amber);
}
.login-hero-copy p {
  max-width: 470px;
  margin: 0;
  color: rgba(255,255,255,.72);
  font-size: 20px;
  line-height: 1.45;
}
.login-copyright {
  position: relative;
  z-index: 1;
  margin-top: auto;
  color: rgba(255,255,255,.42);
  font-size: 15px;
  font-weight: 700;
}
.login-panel {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px;
  background: #fff;
}
.login-card { width: min(100%, 640px); }
.login-title {
  color: var(--accent);
  font-size: 48px;
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 8px;
}
.login-sub {
  color: #6c717a;
  font-size: 21px;
  font-weight: 500;
  margin-bottom: 52px;
}
.login-alert {
  margin-top: -28px;
  margin-bottom: 26px;
  font-size: 14px;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.form-group  { margin-bottom: 0; }
.form-label  {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: #626872;
  margin-bottom: 10px;
}
.form-input  {
  width: 100%;
  height: 66px;
  border: 1px solid #c8ccd1;
  border-radius: 5px;
  padding: 0 24px;
  background: #fff;
  color: var(--text);
  font-size: 19px;
  font-weight: 600;
  font-family: var(--font);
  transition: border-color .15s, box-shadow .15s;
}
.form-input::placeholder { color: #9aa3af; font-weight: 700; }
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(114,36,108,.12);
}
.password-field { position: relative; }
.password-field .form-input { padding-right: 64px; }
.password-toggle {
  position: absolute;
  right: 17px;
  top: 50%;
  width: 36px;
  height: 36px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #8a919b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--accent);
  background: rgba(114,36,108,.08);
  outline: none;
}
.password-toggle svg {
  width: 23px; height: 23px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 6px;
}
.login-check {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #70757e;
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
}
.login-check input { width: 23px; height: 23px; accent-color: var(--accent); cursor: pointer; }
.login-link { color: var(--accent); font-weight: 800; text-decoration: none; }
.login-link:hover { text-decoration: underline; }
.login-submit {
  width: 100%;
  min-height: 66px;
  margin-top: 2px;
  background: linear-gradient(90deg, #6b3491 0%, #a81872 100%);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 16px 22px;
  font-size: 21px;
  font-weight: 900;
  cursor: pointer;
  font-family: var(--font);
  box-shadow: 0 10px 22px rgba(114,36,108,.18);
  transition: transform .16s, box-shadow .16s, filter .16s;
}
.login-submit:hover,
.login-submit:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 14px 26px rgba(114,36,108,.24);
  outline: none;
}
@media (max-width: 1100px) {
  .login-wrap { grid-template-columns: 44% 56%; }
  .login-hero { padding: 52px 42px; }
  .login-hero-copy { padding-bottom: 120px; }
  .login-panel { padding: 44px; }
  .login-title { font-size: 40px; }
  .login-sub { font-size: 18px; margin-bottom: 38px; }
}
@media (max-width: 820px) {
  .login-wrap { display: flex; flex-direction: column; }
  .login-hero { min-height: auto; padding: 34px 28px; }
  .login-platform-name { margin-top: 18px; }
  .login-hero-copy { margin-top: 58px; padding-bottom: 28px; }
  .login-hero-copy h1 { font-size: 34px; }
  .login-hero-copy p { font-size: 16px; }
  .login-copyright { font-size: 12px; }
  .login-panel { min-height: auto; padding: 36px 24px 48px; }
  .login-card { max-width: 560px; }
}
@media (max-width: 520px) {
  .login-logo-sub::after { width: 72px; }
  .login-title { font-size: 36px; }
  .login-sub { font-size: 17px; margin-bottom: 30px; }
  .form-label, .login-check { font-size: 16px; }
  .form-input, .login-submit { min-height: 58px; height: 58px; font-size: 17px; }
  .login-options { align-items: flex-start; flex-direction: column-reverse; gap: 14px; }
}

/* ---- Error pages ----------------------------------------- */
.error-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  gap: 16px;
  background: var(--bg);
  text-align: center;
}
.error-code { font-size: 72px; font-weight: 900; color: var(--accent); letter-spacing: -4px; }
.error-msg  { font-size: 18px; font-weight: 700; color: var(--text); }
.error-sub  { font-size: 13px; color: var(--muted); }
.error-link { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 13px; }
.error-link:hover { text-decoration: underline; }

/* ---- Responsive ------------------------------------------ */
@media (max-width: 1280px) {
  .g5 { grid-template-columns: repeat(5, minmax(180px,1fr)); overflow-x: auto; }
}
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 800px) {
  .g3 { grid-template-columns: repeat(2,1fr); }
  .g2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .content { padding: 20px 16px; }
  .pager-row { justify-content: flex-start; }
  .pager-info { flex-basis: 100%; margin-right: 0; }
  .edit-modal-overlay { padding: 0; align-items: stretch; justify-content: flex-end; }
  .edit-modal {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  .edit-form-grid { grid-template-columns: 1fr; }
  .readonly-grid { grid-template-columns: 1fr; }
  .edit-actions { justify-content: stretch; }
  .edit-btn { flex: 1 1 0; }
  .filter-row > .form-select,
  .filter-row > .form-control,
  .filters-row > .form-select,
  .filters-row > .form-control { flex-basis: 100%; }
}

/* ---- Authenticated app type scale ------------------------ */
body:not(.auth-login-page) { font-size: 15px; }
body:not(.auth-login-page) .brand-name { font-size: 15px; }
body:not(.auth-login-page) .brand-sub { font-size: 11px; }
body:not(.auth-login-page) .header-title { font-size: 16px; }
body:not(.auth-login-page) .header-sub { font-size: 12px; }
body:not(.auth-login-page) .user-avatar { font-size: 12px; }
body:not(.auth-login-page) .user-name { font-size: 13.5px; }
body:not(.auth-login-page) .sl { font-size: 11px; }
body:not(.auth-login-page) .ni,
body:not(.auth-login-page) .ni-sub { font-size: 14px; }
body:not(.auth-login-page) .ni-cnt { font-size: 11px; }
body:not(.auth-login-page) .sec-hdr h2 { font-size: 24px; }
body:not(.auth-login-page) .sec-hdr p { font-size: 14px; }
body:not(.auth-login-page) .entity-add-btn { font-size: 13px; }
body:not(.auth-login-page) .ct { font-size: 12px; }
body:not(.auth-login-page) .b { font-size: 12px; }
body:not(.auth-login-page) table { font-size: 14px; }
body:not(.auth-login-page) th { font-size: 11px; }
body:not(.auth-login-page) .pager-info,
body:not(.auth-login-page) .table-action-btn,
body:not(.auth-login-page) .edit-field input,
body:not(.auth-login-page) .edit-field select,
body:not(.auth-login-page) .edit-field textarea,
body:not(.auth-login-page) .edit-btn,
body:not(.auth-login-page) .readonly-value,
body:not(.auth-login-page) .readonly-section h4,
body:not(.auth-login-page) .readonly-section p,
body:not(.auth-login-page) .readonly-section li { font-size: 14px; }
body:not(.auth-login-page) .pager-row .pager-btn { font-size: 14px; }
body:not(.auth-login-page) .edit-eyebrow,
body:not(.auth-login-page) .edit-field label,
body:not(.auth-login-page) .readonly-label,
body:not(.auth-login-page) .readonly-muted { font-size: 12px; }
body:not(.auth-login-page) .readonly-table { font-size: 13px; }
body:not(.auth-login-page) .edit-message { font-size: 13px; }
body:not(.auth-login-page) .edit-modal h3 { font-size: 21px; }
body:not(.auth-login-page) .ask-omega-fab { font-size: 15px; }

/* ═══════════════════════════════════════════════════════════════════════
   ASK OMEGA — Floating chat panel
   ════════════════════════════════════════════════════════════════════════ */

/* FAB button */
.ask-omega-fab {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 360;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 14px 32px rgba(114,36,108,.32), 0 2px 8px rgba(0,0,0,.16);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, opacity .2s;
}
.ask-omega-fab:hover {
  background: #852c7e;
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(114,36,108,.38), 0 4px 12px rgba(0,0,0,.18);
}
.ask-omega-fab svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
/* Hide FAB while sidebar is open */
body.ask-omega-open .ask-omega-fab { opacity: 0; pointer-events: none; }

/* Sidebar wrapper — dims background when open */
.ask-omega-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  background: rgba(0,0,0,0);
  transition: background .28s ease;
}
.ask-omega-overlay.open {
  pointer-events: none; /* let clicks pass through the dark area */
  background: rgba(0,0,0,.35);
}
/* Only the panel itself captures pointer events */
.ask-omega-overlay .ask-omega-panel { pointer-events: auto; }

/* Panel — full-height right-side sidebar */
.ask-omega-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 860px;
  max-width: 100vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 40px rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  pointer-events: auto;
}
.ask-omega-overlay.open .ask-omega-panel {
  transform: translateX(0);
}

.ask-omega-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ask-omega-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.ask-omega-title svg {
  width: 18px; height: 18px;
  fill: none; stroke: var(--accent);
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.ask-omega-close {
  width: 30px; height: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.ask-omega-close:hover { border-color: var(--accent); color: var(--accent); }
.ask-omega-close svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* Messages area */
.ask-omega-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
}

/* Chat message wrapper */
.chat-msg { display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.bot  { justify-content: flex-start; }

/* Bubble */
.chat-bubble {
  max-width: 82%;
  border-radius: 14px;
  padding: 9px 13px;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}
.chat-msg.user .chat-bubble {
  background: var(--accent);
  color: #fff;
  border-radius: 14px 14px 4px 14px;
}
.chat-msg.bot .chat-bubble {
  background: var(--surface2);
  color: var(--text);
  border-radius: 14px 14px 14px 4px;
}
.chat-bubble ul { margin: 10px 0 10px 18px; padding: 0; }
.chat-bubble ol { margin: 10px 0 10px 18px; padding: 0; }
.chat-bubble li { margin-bottom: 6px; }
.chat-bubble p  { margin: 4px 0; }
.chat-bubble strong { font-weight: 600; }
.chat-bubble em { font-style: italic; }
.chat-bubble code { background: rgba(0,0,0,.07); padding: 1px 5px; border-radius: 3px; font-size: 12px; font-family: monospace; }

.chat-suggestions {
  width: min(640px, 96%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.chat-suggestions-title {
  flex: 0 0 100%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .5px;
  line-height: 1.2;
  text-transform: uppercase;
}
.chat-suggestion {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface2);
  color: var(--text2);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.chat-suggestion:hover,
.chat-suggestion:focus {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
  outline: none;
}

/* Typing indicator */
@keyframes chat-dot-bounce {
  0%, 80%, 100% { transform: translateY(0);   opacity: .4; }
  40%           { transform: translateY(-5px); opacity: 1;  }
}
.chat-typing { display: flex; align-items: center; gap: 4px; padding: 2px 0; }
.chat-typing span {
  display: inline-block; width: 7px; height: 7px;
  background: var(--muted2); border-radius: 50%;
  animation: chat-dot-bounce 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }

@keyframes chat-caret-blink {
  0%, 48% { opacity: 1; }
  49%, 100% { opacity: 0; }
}
.chat-bubble.chat-streaming {
  white-space: normal;
}
.chat-bubble.chat-streaming::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 1.1em;
  margin-left: 3px;
  border-radius: 2px;
  background: var(--accent);
  vertical-align: -2px;
  animation: chat-caret-blink .9s steps(1) infinite;
}

/* Input row */
.ask-omega-input-row {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.ask-omega-input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  outline: none;
}
.ask-omega-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(114,36,108,.1);
}
.ask-omega-send {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.ask-omega-send:hover { background: #5e1d59; }
.ask-omega-send:disabled { opacity: .6; cursor: wait; }
.ask-omega-send svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* Markdown content inside bot bubbles */
.chat-bubble .md-h1 { font-size: 15px; font-weight: 700; margin: 14px 0 6px; }
.chat-bubble .md-h2 { font-size: 14px; font-weight: 700; margin: 12px 0 5px; }
.chat-bubble .md-h3 { font-size: 13px; font-weight: 600; margin: 10px 0 4px; }
.chat-bubble .md-hr { border: none; border-top: 1px solid var(--border); margin: 8px 0; }
.chat-bubble .md-pre {
  background: rgba(0,0,0,.07); border-radius: 6px;
  padding: 8px 10px; margin: 6px 0;
  font-family: monospace; font-size: 12px;
  overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}
[data-theme="dark"] .chat-bubble .md-pre { background: rgba(255,255,255,.08); }
.chat-bubble .md-table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 12px 0; }
.chat-bubble .md-table th,
.chat-bubble .md-table td { border: 1px solid var(--border); padding: 4px 8px; text-align: left; }
.chat-bubble .md-table th { background: var(--surface2); font-weight: 600; }
.chat-msg.bot .chat-bubble { max-width: 96%; }

@media (max-width: 600px) {
  .ask-omega-panel { width: 100vw; }
  .ask-omega-fab { right: 16px; bottom: 16px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   IT BUSINESS PARTNERSHIP
════════════════════════════════════════════════════════════════════════ */

/* Area cards grid */
.bp-area-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
}
.bp-area-card {
  flex: 1 1 calc(20% - 10px);
  min-width: 180px;
  box-sizing: border-box;
}
@media (max-width: 1200px) { .bp-area-card { flex-basis: calc(33.333% - 9px); } }
@media (max-width: 800px)  { .bp-area-card { flex-basis: calc(50% - 6px); } }
@media (max-width: 500px)  { .bp-area-card { flex-basis: 100%; } }

.bp-area-card {
  cursor: pointer;
  transition: box-shadow .15s, transform .1s;
  padding: 0;
  border-left: 4px solid var(--border);
  overflow: hidden;
}
.bp-area-card.bp-card-green { border-left-color: var(--green); }
.bp-area-card.bp-card-amber { border-left-color: var(--amber); }
.bp-area-card.bp-card-red   { border-left-color: var(--red); }
.bp-area-card:hover { transform: translateY(-2px); box-shadow: 0 4px 18px rgba(0,0,0,.13); }

.bp-area-card-inner { padding: 13px 14px; }

.bp-area-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.bp-area-name { font-weight: 700; font-size: 13px; color: var(--text); line-height: 1.3; }
.bp-pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.bp-pulse-dot.bp-dot-green { background: var(--green); }
.bp-pulse-dot.bp-dot-amber { background: var(--amber); }
.bp-pulse-dot.bp-dot-red   { background: var(--red); }
.bp-pulse-dot.bp-dot-none  { background: var(--muted2); }

.bp-pulse-badge { font-size: 11px; white-space: nowrap; flex-shrink: 0; }

.bp-area-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}
.bp-area-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bp-area-meta-item {
  display: flex;
  align-items: center;
  gap: 3px;
}
.bp-fu-strip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  background: var(--amber-light);
  border-top: 1px solid rgba(240,179,35,.25);
  font-size: 10px;
  font-weight: 600;
  color: #92620a;
}
.bp-fu-strip svg { flex-shrink: 0; }
.bp-fu-badge { display: inline-block; background: var(--amber); color: #fff; border-radius: 10px; padding: 1px 8px; font-size: 10px; font-weight: 600; }

/* Conversation table */
.bp-summary-cell { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Pulse picker in form */
.bp-pulse-picker { display: flex; gap: 10px; }
.bp-pulse-btn {
  flex: 1; padding: 8px 0; border: 2px solid var(--border); border-radius: 8px;
  background: var(--surface); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s;
  color: var(--muted);
}
.bp-pulse-btn.bp-pulse-green.selected, .bp-pulse-btn.bp-pulse-green:hover { border-color: var(--green); color: var(--green); background: rgba(72,162,63,.1); }
.bp-pulse-btn.bp-pulse-amber.selected, .bp-pulse-btn.bp-pulse-amber:hover { border-color: var(--amber); color: var(--amber); background: rgba(240,179,35,.1); }
.bp-pulse-btn.bp-pulse-red.selected,   .bp-pulse-btn.bp-pulse-red:hover   { border-color: var(--red);   color: var(--red);   background: rgba(220,107,47,.1); }

/* Conversation detail overlay */
.bp-detail-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.bp-detail-area { font-weight: 700; font-size: 15px; color: var(--text); }
.bp-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin-bottom: 16px; font-size: 13px; }
.bp-detail-label { font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; display: block; margin-bottom: 2px; }
.bp-detail-section { margin-bottom: 16px; }
.bp-detail-section p { font-size: 13px; color: var(--text); margin: 0; }
.btn-link-inline { background: none; border: none; color: var(--accent); font-size: 12px; cursor: pointer; padding: 0; text-decoration: underline; }

/* Icon-only action buttons (edit / delete / complete) */
.icon-action-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: background .14s, border-color .14s, color .14s;
  flex-shrink: 0;
}
.icon-action-btn svg { width: 14px; height: 14px; }
.icon-action-btn:hover { background: var(--surface2); border-color: var(--accent); color: var(--accent); }
.icon-action-btn--danger:hover  { border-color: var(--red);   color: var(--red);   background: var(--red-light); }
.icon-action-btn--success:hover { border-color: var(--green); color: var(--green); background: var(--green-light); }

/* Follow-up items */
.bp-fu-item { padding: 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; }
.bp-fu-item.bp-fu-done { opacity: .55; }
.bp-fu-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.bp-fu-desc { font-size: 13px; color: var(--text); }
.bp-fu-meta { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bp-fu-complete-btn { font-size: 11px; }

/* SLT pulse chips (used in BP overview cards and SLT pulse endpoint output) */
.bp-pulse-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0; min-height: 36px; }
.bp-slt-chip {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 13px 7px 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
  border-left-width: 4px;
  background: var(--surface);
  font-size: 12px;
  cursor: default;
  transition: box-shadow .15s, transform .1s;
}
.bp-slt-chip:hover { box-shadow: 0 3px 12px rgba(0,0,0,.12); transform: translateY(-1px); }
.bp-slt-chip.bp-slt-stale { opacity: .55; }
.bp-slt-green { border-left-color: var(--green); background: var(--green-light); }
.bp-slt-amber { border-left-color: var(--amber); background: var(--amber-light); }
.bp-slt-red   { border-left-color: var(--red);   background: var(--red-light);   }
.bp-slt-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.bp-slt-green .bp-slt-dot { background: var(--green); }
.bp-slt-amber .bp-slt-dot { background: var(--amber); }
.bp-slt-red   .bp-slt-dot { background: var(--red);   }
.bp-slt-none  .bp-slt-dot { background: var(--muted2); }
.bp-slt-name { font-weight: 700; }
.bp-slt-pulse-label { font-size: 10px; font-weight: 600; color: var(--muted); }
.bp-slt-green .bp-slt-pulse-label { color: var(--green); }
.bp-slt-amber .bp-slt-pulse-label { color: #92620a; }
.bp-slt-red   .bp-slt-pulse-label { color: var(--red); }
.bp-slt-fu {
  background: var(--amber); color: #fff;
  border-radius: 10px; padding: 1px 7px;
  font-size: 10px; font-weight: 700;
  flex-shrink: 0;
}

/* ============================================================
   IT BP — Multi-tab Upgrade Styles
   ============================================================ */

/* ---- Tab bar -------------------------------------------- */
.bp-tab-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.bp-tab {
  padding: 10px 18px;
  border: none; background: none;
  font-family: var(--font);
  font-size: 13px; font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  border-radius: 6px 6px 0 0;
  transition: color .15s, border-color .15s, background .15s;
}
.bp-tab:hover  { color: var(--text); background: var(--surface2); }
.bp-tab.active { color: var(--accent); font-weight: 700; border-bottom-color: var(--accent); }
.bp-tab-actions { margin-left: auto; padding-bottom: 4px; }
.bp-page-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 12px;
  min-width: 0;
}
.bp-page-actions .entity-add-btn {
  flex: 0 0 auto;
}
.bp-page-actions--button-only {
  justify-content: flex-end;
}

/* ---- Tab panes ------------------------------------------ */
.bp-tab-pane         { display: none; }
.bp-tab-pane.active  { display: block; }

/* ---- Pulse area chips ----------------------------------- */
.bp-chips-row {
  display: flex;
  gap: 6px;
  overflow: hidden;
  padding-bottom: 0;
  min-width: 0;
}
.bp-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px; font-weight: 500; color: var(--text);
  cursor: pointer; white-space: nowrap;
  transition: all .15s;
  font-family: var(--font);
}
.bp-chip:hover  { background: var(--surface2); border-color: var(--border2); }
.bp-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.bp-chip.active .bp-chip-dot { opacity: 1; }
.bp-chip-dot { width: 7px; height: 7px; border-radius: 50%; }
.bp-chip-count {
  background: rgba(0,0,0,.08);
  border-radius: 10px; padding: 0 6px;
  font-size: 10px; font-weight: 700;
}
.bp-chip.active .bp-chip-count { background: rgba(255,255,255,.25); }
.bp-chip-green { border-color: var(--green-light); }
.bp-chip-amber { border-color: var(--amber-light); }
.bp-chip-red   { border-color: var(--red-light); }
.bp-chip-green.active { background: var(--green); border-color: var(--green); }
.bp-chip-amber.active { background: var(--amber); border-color: var(--amber); }
.bp-chip-red.active   { background: var(--red);   border-color: var(--red); }
.bp-dot-green  { background: var(--green); }
.bp-dot-amber  { background: var(--amber); }
.bp-dot-red    { background: var(--red); }
.bp-dot-none   { background: var(--muted2); }

/* ---- KPI bar -------------------------------------------- */
.bp-kpi-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.bp-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  width: 100%;
  text-align: left;
  font-family: var(--font);
  color: inherit;
  appearance: none;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .12s, background .15s;
}
.bp-kpi-card:hover {
  border-color: var(--border2);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}
.bp-kpi-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light), var(--shadow);
  background: var(--surface);
}
.bp-kpi-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.bp-kpi-value {
  font-size: 26px; font-weight: 800;
  color: var(--text); letter-spacing: -.5px; line-height: 1.1;
}
.bp-kpi-value.bp-kpi-green { color: var(--green); }
.bp-kpi-value.bp-kpi-amber { color: #92620a; }
.bp-kpi-value.bp-kpi-red   { color: var(--red); }
.bp-kpi-label {
  font-size: 11px; font-weight: 500;
  color: var(--muted); margin-top: 4px;
  text-transform: uppercase; letter-spacing: .5px;
}

/* ---- Senior Leadership dashboard ------------------------ */
.slt-dashboard {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.slt-dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 2px;
}
.slt-dashboard-header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
}
.slt-eyebrow,
.slt-panel-kicker {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.slt-kpi-card {
  cursor: default;
}
.slt-kpi-card:hover {
  transform: none;
}
.slt-kpi-note {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted2);
}
.slt-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 12px;
  align-items: start;
}
.slt-panel-brief {
  grid-row: span 2;
}
.slt-panel-actions {
  grid-column: 2;
}
.slt-panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}
.slt-panel-wide {
  grid-column: 1 / -1;
}
.slt-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.slt-panel-header h2 {
  margin: 2px 0 0;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 800;
  color: var(--text);
}
.slt-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.slt-chart-wrap {
  position: relative;
  min-height: 240px;
}
.slt-chart-wrap-wide {
  min-height: 250px;
}
.slt-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}
.slt-chart-message {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}
.slt-brief-body {
  min-height: 170px;
}
.slt-brief-summary {
  margin: 0 0 14px;
  color: var(--text2);
  font-size: 13px;
}
.slt-brief-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.slt-brief-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface2);
}
.slt-brief-section h3 {
  margin: 0 0 7px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
}
.slt-brief-section ul {
  margin: 0;
  padding-left: 17px;
  color: var(--text2);
  font-size: 12px;
}
.slt-brief-section li + li {
  margin-top: 5px;
}
.slt-brief-risk { border-left: 4px solid var(--red); }
.slt-brief-decision { border-left: 4px solid var(--amber); }
.slt-brief-win { border-left: 4px solid var(--green); }
.slt-brief-action { border-left: 4px solid var(--cyan); }
.slt-brief-unavailable {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--muted);
  font-size: 12px;
}
.slt-brief-unavailable strong {
  color: var(--text);
  font-size: 13px;
}
.slt-table-wrap {
  max-height: 420px;
  overflow: auto;
}
.slt-table th,
.slt-table td {
  vertical-align: middle;
}
.slt-signal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.slt-signal {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.slt-action-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.slt-action-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  min-height: 62px;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  font-family: var(--font);
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.slt-action-item:hover {
  background: var(--surface2);
  border-color: var(--border2);
  box-shadow: var(--shadow);
}
.slt-action-overdue {
  border-left-color: var(--red);
}
.slt-action-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}
.slt-action-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}
.slt-overdue-label {
  color: var(--red);
  font-weight: 800;
}
.slt-error-banner {
  margin-bottom: 12px;
}

@media (max-width: 1120px) {
  .slt-dashboard-grid {
    grid-template-columns: 1fr;
  }
  .slt-panel-brief,
  .slt-panel-actions {
    grid-column: auto;
    grid-row: auto;
  }
  .slt-panel-wide {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .slt-dashboard-header {
    align-items: stretch;
    flex-direction: column;
  }
  .slt-dashboard-header h1 {
    font-size: 21px;
  }
  .slt-brief-sections {
    grid-template-columns: 1fr;
  }
  .slt-panel {
    padding: 13px;
  }
  .slt-table-wrap {
    max-height: none;
  }
}

/* ---- Overview toolbar (chips left + controls right) ---- */
.bp-overview-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}
.bp-overview-toolbar .bp-chips-row {
  flex: 1 1 auto;
  min-width: 0;
}
.bp-overflow-strip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}
.bp-overflow-strip-tabs,
.bp-overflow-strip-chips {
  flex: 1 1 auto;
  min-width: 0;
}
.bp-overview-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.bp-conversation-tabs {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: 6px;
  overflow: hidden;
  padding-bottom: 0;
}
.bp-overflow-item-hidden {
  display: none !important;
}
.bp-overflow-btn {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.bp-overflow-btn[hidden] {
  display: none !important;
}
.bp-overflow-btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}
.bp-overflow-btn:hover,
.bp-overflow-btn.active {
  background: var(--surface2);
  border-color: var(--border2);
  color: var(--text);
}
.bp-overflow-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 430;
  width: min(320px, 86vw);
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.bp-overflow-menu[hidden] {
  display: none !important;
}
.bp-overflow-menu .bp-conversation-tab,
.bp-overflow-menu .bp-chip {
  width: 100%;
  min-height: 34px;
  justify-content: space-between;
  white-space: normal;
  text-align: left;
}
.bp-overflow-menu .bp-chip {
  border-radius: 8px;
}
.bp-conversation-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.bp-conversation-tab:hover {
  background: var(--surface2);
  border-color: var(--border2);
  color: var(--text);
}
.bp-conversation-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.bp-conversation-tab-green.active { background: var(--green); border-color: var(--green); }
.bp-conversation-tab-amber.active { background: var(--amber); border-color: var(--amber); }
.bp-conversation-tab-red.active { background: var(--red); border-color: var(--red); }
.bp-conversation-tab-seniority.active { background: var(--teal); border-color: var(--teal); }
.bp-conversation-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 7px;
  padding: 0 5px;
  border-radius: 9px;
  background: rgba(0,0,0,.08);
  color: inherit;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}
.bp-conversation-tab.active .bp-conversation-tab-count {
  background: rgba(255,255,255,.24);
}
.bp-ctrl-select {
  height: 32px;
  font-size: 12px;
  padding: 0 8px;
  border-radius: 7px;
  min-width: 130px;
}
.bp-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.bp-search-icon {
  position: absolute;
  left: 8px;
  width: 14px; height: 14px;
  color: var(--muted2);
  pointer-events: none;
}
.bp-search-input {
  height: 32px;
  padding: 0 10px 0 28px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-family: var(--font);
  width: 180px;
  transition: border-color .15s, box-shadow .15s;
}
.bp-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* ---- Filter popup wrap + floating panel ---------------- */
.bp-filter-popup-wrap {
  position: relative;
}
.bp-filter-toggle-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface2);
  font-size: 12px; font-weight: 500; color: var(--muted);
  cursor: pointer; font-family: var(--font);
  transition: all .15s;
  white-space: nowrap;
}
.bp-filter-toggle-btn:hover, .bp-filter-toggle-btn.active {
  border-color: var(--accent); color: var(--accent); background: var(--accent-light);
}
.bp-filter-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 10px; font-weight: 700;
  line-height: 1;
}
.bp-filter-popup {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 200;
  width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.08);
  display: none;
}
.bp-filter-popup.open { display: block; }
.bp-filter-popup-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--text);
}
.bp-filter-popup-header button {
  background: none; border: none; cursor: pointer;
  color: var(--muted2); padding: 2px;
  display: flex; align-items: center;
  transition: color .15s;
}
.bp-filter-popup-header button:hover { color: var(--text); }
.bp-filter-popup-body { padding: 14px 16px; }
.bp-fp-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.bp-fp-row-1col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.bp-fp-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.bp-fp-row label, .bp-fp-row-1col label, .bp-fp-row-2col label {
  display: block; font-size: 10px; font-weight: 600;
  color: var(--muted); text-transform: uppercase;
  letter-spacing: .4px; margin-bottom: 3px;
}
.bp-filter-popup-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--border);
}

/* Legacy inline filter classes kept for compat */
.bp-filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bp-ext-filter-panel { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.bp-ext-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.bp-ext-filter-grid label {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--muted); text-transform: uppercase;
  letter-spacing: .4px; margin-bottom: 3px;
}
.bp-view-toggle { display: flex; gap: 2px; }
.bp-view-btn {
  width: 30px; height: 30px;
  border: 1px solid var(--border);
  border-radius: 6px; background: var(--surface);
  cursor: pointer; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.bp-view-btn:hover  { background: var(--surface2); color: var(--text); }
.bp-view-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---- Conversation cards --------------------------------- */
.bp-conv-grid-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.bp-group-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0 6px;
  font-size: 12px; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid var(--border); margin-bottom: 10px;
}
.bp-group-count {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 1px 8px;
  font-size: 10px; font-weight: 700; color: var(--muted);
}
.bp-group-row td { background: var(--surface2); font-size: 11px; color: var(--muted); padding: 5px 8px; }
.bp-conv-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  border-left: 3px solid var(--border);
  padding: 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: box-shadow .15s, transform .1s, border-left-color .15s;
  display: flex; flex-direction: column; gap: 6px;
}
.bp-conv-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.bp-conv-pulse-green { border-left-color: var(--green); }
.bp-conv-pulse-amber { border-left-color: var(--amber); }
.bp-conv-pulse-red   { border-left-color: var(--red); }
.bp-conv-card-header { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.bp-conv-card-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}
.bp-conv-card-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.bp-conv-card-area   { font-size: 11px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .3px; }
.bp-conv-card-contact { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.bp-conv-card-contact strong { font-size: 13px; font-weight: 700; }
.bp-conv-list-title {
  min-width: 180px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}
.bp-conv-card-role { font-size: 11px; color: var(--muted); }
.bp-conv-card-summary {
  font-size: 12px; color: var(--text2); line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.bp-conv-card-footer {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px;
  margin-top: 4px; font-size: 11px; color: var(--muted);
}
.bp-conv-card-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px;
}
.bp-conv-type {
  font-size: 10px; font-weight: 600;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 6px; color: var(--muted);
}
.bp-level-badge {
  font-size: 10px; font-weight: 600;
  background: var(--cyan-light); color: var(--teal);
  border-radius: 5px; padding: 1px 6px;
}
.bp-att-badge {
  font-size: 10px; font-weight: 600;
  background: var(--surface2); color: var(--muted);
  border-radius: 5px; padding: 1px 6px;
}

/* ---- Seniority badges ----------------------------------- */
.bp-sen-badge {
  display: inline-block;
  font-size: 10px; font-weight: 700;
  border-radius: 5px; padding: 1px 6px;
  text-transform: uppercase; letter-spacing: .3px;
}
.bp-sen-executive      { background: #f3e8ff; color: #7c3aed; }
.bp-sen-vp             { background: #dbeafe; color: #1d4ed8; }
.bp-sen-director       { background: var(--teal-light); color: var(--teal); }
.bp-sen-senior-manager { background: #e0e7ff; color: #4338ca; }
.bp-sen-manager        { background: var(--surface2); color: var(--muted); }
.bp-sen-specialist     { background: var(--surface2); color: var(--muted2); }
[data-theme="dark"] .bp-sen-executive      { background: #3b1a6b; color: #c084fc; }
[data-theme="dark"] .bp-sen-vp             { background: #1e3a6e; color: #93c5fd; }
[data-theme="dark"] .bp-sen-director       { background: #042f2e; color: #5eead4; }
[data-theme="dark"] .bp-sen-senior-manager { background: #1e1b4b; color: #a5b4fc; }

.bp-seniority-auto { min-height: 28px; display: flex; align-items: center; }

/* ---- Right-side drawers --------------------------------- */
.bp-drawer-overlay {
  position: fixed; inset: 0;
  z-index: 400;
  pointer-events: none;
  background: rgba(0,0,0,0);
  transition: background .25s ease;
}
.bp-drawer-overlay.open {
  pointer-events: auto;
  background: rgba(0,0,0,.35);
}
.bp-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 680px; max-width: 95vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 32px rgba(0,0,0,.1);
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  z-index: 401;
  display: flex; flex-direction: column;
}
.bp-drawer-overlay.open .bp-drawer { transform: translateX(0); }
.bp-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.bp-drawer-eyebrow {
  font-size: 16px; font-weight: 700; color: var(--text);
  text-transform: none; letter-spacing: 0;
}
.bp-drawer-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface); cursor: pointer;
  font-size: 18px; color: var(--muted); line-height: 1;
  font-family: var(--font); padding: 0;
  transition: color .15s, background .15s, border-color .15s;
}
.bp-drawer-close:hover { color: var(--text); background: var(--surface2); border-color: var(--muted); }
.bp-drawer-body {
  flex: 1; overflow-y: auto; padding: 20px;
}

/* ---- Conversation detail content ----------------------- */
.bp-conv-detail-panel {
  margin-bottom: 18px;
  padding: 14px 16px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
}
.bp-conv-detail-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.bp-conv-detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 22px;
}
.bp-detail-fact {
  min-width: 0;
}
.bp-detail-value {
  display: block;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}
.bp-detail-value-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.bp-detail-link {
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.bp-detail-link:hover {
  text-decoration: underline;
}
.bp-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-bottom: 16px;
  font-size: 13px;
}
.bp-detail-label {
  font-size: 10px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px;
  display: block; margin-bottom: 2px;
}
.bp-detail-section { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.bp-detail-section:last-child { border-bottom: none; }
.bp-fu-item { padding: 8px 0; border-bottom: 1px solid var(--border); }
.bp-fu-item:last-child { border-bottom: none; }
.bp-fu-row  { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.bp-fu-desc { font-size: 13px; flex: 1; }
.bp-fu-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.bp-fu-notes { font-size: 11px; color: var(--muted2); margin-top: 4px; font-style: italic; }
.bp-fu-done .bp-fu-desc { text-decoration: line-through; color: var(--muted2); }
.bp-fu-overdue .bp-fu-desc { color: var(--red); }
.bp-att-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12px; }
.bp-att-row a { color: var(--accent); text-decoration: none; }
.bp-att-row a:hover { text-decoration: underline; }
.bp-att-size { color: var(--muted2); font-size: 11px; }

/* ---- Person drawer -------------------------------------- */
.bp-person-header {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 16px;
}
.bp-person-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.bp-person-name { font-size: 16px; font-weight: 700; }
.bp-area-tag {
  display: inline-block;
  font-size: 10px; font-weight: 600;
  background: var(--accent-light); color: var(--accent);
  border-radius: 5px; padding: 1px 6px;
  margin: 1px;
}
.bp-sparkline { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.bp-spark-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.bp-timeline { display: flex; flex-direction: column; gap: 8px; }
.bp-timeline-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px; border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: background .15s;
}
.bp-timeline-item:hover { background: var(--surface2); }
.bp-timeline-pulse { flex-shrink: 0; }
.bp-timeline-body  { flex: 1; min-width: 0; }
.bp-timeline-summary { font-size: 12px; color: var(--text2); margin-top: 3px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---- People grid ---------------------------------------- */
.bp-people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.bp-person-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: box-shadow .15s, transform .1s;
}
.bp-person-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.bp-person-card-top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.bp-person-card-stats { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }
.bp-person-areas { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 6px; }

/* ---- Follow-ups tab ------------------------------------- */
.bp-fu-status-tabs { display: flex; gap: 4px; }
.bp-fu-tab {
  padding: 5px 14px;
  border: 1px solid var(--border); border-radius: 20px;
  background: var(--surface); font-family: var(--font);
  font-size: 12px; font-weight: 500; color: var(--muted);
  cursor: pointer; transition: all .15s;
}
.bp-fu-tab:hover  { background: var(--surface2); color: var(--text); }
.bp-fu-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.bp-fu-overdue-row { background: var(--red-light) !important; }
.bp-fu-overdue-row:hover { background: #fde0d0 !important; }
[data-theme="dark"] .bp-fu-overdue-row { background: rgba(220,107,47,.12) !important; }

/* ---- Info banner ---------------------------------------- */
.bp-info-banner {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
  background: var(--cyan-light);
  border: 1px solid rgba(65,182,230,.2);
  border-radius: 10px;
  font-size: 12px; color: var(--text2); line-height: 1.5;
}
.bp-info-banner svg { flex-shrink: 0; color: var(--teal); margin-top: 1px; }
[data-theme="dark"] .bp-info-banner { background: rgba(13,148,136,.08); border-color: rgba(13,148,136,.2); }

/* ---- File dropzone ------------------------------------- */
.bp-dropzone {
  border: 2px dashed var(--border);
  border-radius: 10px; padding: 20px;
  text-align: center; color: var(--muted);
  font-size: 13px; cursor: default;
  transition: border-color .15s, background .15s;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.bp-dropzone.drag-over { border-color: var(--accent); background: var(--accent-light); }
.bp-dropzone svg { color: var(--muted2); }
.bp-file-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.bp-file-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 6px; background: var(--surface2);
  font-size: 12px;
}
.bp-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-file-size { color: var(--muted2); font-size: 11px; flex-shrink: 0; }

/* ---- Seniority auto badge in form ---------------------- */
.bp-seniority-auto {
  font-size: 13px; min-height: 32px;
  display: flex; align-items: center;
}

/* ---- Overrides for existing components ----------------- */
.bp-pulse-btn {
  border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 14px;
  font-family: var(--font); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .15s;
  background: var(--surface); color: var(--muted);
}
.bp-pulse-green.selected, .bp-pulse-green:hover { background: var(--green-light); border-color: var(--green); color: var(--green); }
.bp-pulse-amber.selected, .bp-pulse-amber:hover { background: var(--amber-light); border-color: var(--amber); color: #92620a; }
.bp-pulse-red.selected,   .bp-pulse-red:hover   { background: var(--red-light);   border-color: var(--red);   color: var(--red); }

/* App toast notifications */
.app-toast-host {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1400;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.app-toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 8px 1fr 28px;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  animation: appToastIn .18s ease-out;
}
.app-toast.is-leaving {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease;
}
.app-toast-indicator {
  width: 8px;
  height: 34px;
  border-radius: 999px;
  background: var(--green);
}
.app-toast-info .app-toast-indicator { background: var(--teal); }
.app-toast-error .app-toast-indicator { background: var(--red); }
.app-toast-message {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}
.app-toast-close {
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.app-toast-close:hover {
  border-color: var(--border);
  color: var(--text);
  background: var(--surface2);
}
@keyframes appToastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (max-width: 640px) {
  .app-toast-host {
    top: 12px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}

/* App confirmation dialog */
.app-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(2px);
  animation: appConfirmFadeIn .16s ease-out;
}
.app-confirm-overlay.is-leaving {
  opacity: 0;
  transition: opacity .16s ease;
}
.app-confirm-dialog {
  width: min(480px, 100%);
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 18px 14px;
  position: relative;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
  animation: appConfirmIn .18s ease-out;
}
.app-confirm-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.app-confirm-close:hover {
  color: var(--text);
  background: var(--surface2);
}
.app-confirm-icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--red-light);
  color: var(--red);
  font-size: 22px;
  font-weight: 900;
}
.app-confirm-content {
  padding-right: 34px;
}
.app-confirm-content h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}
.app-confirm-content p {
  margin: 0;
  color: var(--text2);
  font-size: 13px;
  line-height: 1.55;
}
.app-confirm-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 2px;
}
.app-confirm-btn {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 9px;
  border: 1px solid var(--border);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.app-confirm-cancel {
  background: var(--surface);
  color: var(--text2);
}
.app-confirm-cancel:hover {
  background: var(--surface2);
  color: var(--text);
}
.app-confirm-primary {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}
.app-confirm-primary:hover {
  filter: brightness(.95);
}
@keyframes appConfirmFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes appConfirmIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 520px) {
  .app-confirm-dialog {
    grid-template-columns: 1fr;
    padding: 22px;
  }
  .app-confirm-content {
    padding-right: 30px;
  }
  .app-confirm-actions {
    flex-direction: column-reverse;
  }
  .app-confirm-btn {
    width: 100%;
  }
}
