/* booknip Response — design system. Colours come from the booknip logo pack (brand/). */
:root {
  --bn-blue: #054BA9;
  --bn-blue-600: #043d8a;
  --bn-navy: #0B1F3F;
  --bn-navy-2: #132c55;
  --bn-cyan: #08ACC9;
  --bn-gold: #BB9A28;
  --bn-bg: #f4f6fa;
  --bn-surface: #ffffff;
  --bn-surface-2: #f8fafc;
  --bn-border: #e3e8ef;
  --bn-text: #14213a;
  --bn-muted: #5f6b80;
  --bn-ok: #126c43; /* NFR-08: 4.5:1 on white and on the tinted chip background */
  --bn-warn: #8f5d10; /* NFR-08: 5.6:1 on white, 4.9:1 on the warning chip */
  --bn-danger: #c2410c;
  --bn-ai: #6d4dd8;
  /* Text colours that keep 4.5:1 contrast on tinted chips and page backgrounds (axe colour-contrast, track QA) */
  --bn-ok-text: #11683f; --bn-warn-text: #7f5210; --bn-danger-text: #a3330a; --bn-ai-text: #5537b8; --bn-sim-text: #665009; --bn-info-text: #054BA9;
  --bs-link-color-rgb: 5, 75, 169; --bs-link-hover-color-rgb: 4, 61, 138;
  --bn-radius: 12px;
  --bn-shadow: 0 1px 2px rgba(11, 31, 63, .06), 0 4px 16px rgba(11, 31, 63, .06);
  --bn-font: -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
  --bs-primary: var(--bn-blue);
  --bs-primary-rgb: 5, 75, 169;
  --bs-link-color: var(--bn-blue);
  --bs-link-color-rgb: 5, 75, 169;
  --bs-link-hover-color-rgb: 4, 61, 138;
  --bs-secondary-color: #5c6570; /* muted text and inactive tabs: 5.5:1 on the page background */
  --bs-secondary-rgb: 92, 101, 112;
  --bs-body-font-family: var(--bn-font);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bn-bg: #0a1426; --bn-surface: #111d33; --bn-surface-2: #0e1a2e; --bn-border: #233452;
    --bn-text: #e6ecf5; --bn-muted: #a9b6cb; --bs-body-bg: #0a1426; --bs-body-color: #e6ecf5;
    --bn-ok-text: #6ee0a6; --bn-warn-text: #f3c069; --bn-danger-text: #ff9a70; --bn-ai-text: #c2b1ff; --bn-sim-text: #ead27a; --bn-info-text: #9cc3ff;
    --bs-link-color: #9cc3ff; --bs-link-hover-color: #c4dcff; --bs-link-color-rgb: 156, 195, 255; --bs-link-hover-color-rgb: 196, 220, 255; --bs-secondary-color: #b4c0d4; --bs-code-color: #f7a8d0;
    --bn-ok: #45c486; --bn-warn: #e0a84a;
  }
}
:root[data-theme="dark"] {
  --bn-bg: #0a1426; --bn-surface: #111d33; --bn-surface-2: #0e1a2e; --bn-border: #233452;
  --bn-text: #e6ecf5; --bn-muted: #a9b6cb; --bs-body-bg: #0a1426; --bs-body-color: #e6ecf5;
    --bn-ok-text: #6ee0a6; --bn-warn-text: #f3c069; --bn-danger-text: #ff9a70; --bn-ai-text: #c2b1ff; --bn-sim-text: #ead27a; --bn-info-text: #9cc3ff;
    --bs-link-color: #9cc3ff; --bs-link-hover-color: #c4dcff; --bs-link-color-rgb: 156, 195, 255; --bs-link-hover-color-rgb: 196, 220, 255; --bs-secondary-color: #b4c0d4; --bs-code-color: #f7a8d0;
  --bn-ok: #45c486; --bn-warn: #e0a84a;
}
html, body { height: 100%; }
body { background: var(--bn-bg); color: var(--bn-text); font-family: var(--bn-font); }
.btn-primary { --bs-btn-bg: var(--bn-blue); --bs-btn-border-color: var(--bn-blue); --bs-btn-hover-bg: var(--bn-blue-600); --bs-btn-hover-border-color: var(--bn-blue-600); --bs-btn-active-bg: var(--bn-navy); }
/* NFR-08: Bootstrap's grey outline buttons are 4.3:1 on the page background; darkened to 5.5:1. */
.btn-outline-secondary { --bs-btn-color: #5c6570; --bs-btn-border-color: #8a939d; --bs-btn-hover-bg: #5c6570; --bs-btn-hover-border-color: #5c6570; --bs-btn-active-bg: #4f5761; --bs-btn-active-border-color: #4f5761; }
:root[data-theme="dark"] .btn-outline-secondary { --bs-btn-color: #a7b3c6; --bs-btn-border-color: #5f6b80; }
.btn-outline-primary { --bs-btn-color: var(--bn-blue); --bs-btn-border-color: var(--bn-blue); --bs-btn-hover-bg: var(--bn-blue); --bs-btn-hover-border-color: var(--bn-blue); }
.text-muted, .bn-muted { color: var(--bn-muted) !important; }
.card, .bn-card { background: var(--bn-surface); border: 1px solid var(--bn-border); border-radius: var(--bn-radius); box-shadow: var(--bn-shadow); color: var(--bn-text); }
.form-control, .form-select { background-color: var(--bn-surface); color: var(--bn-text); border-color: var(--bn-border); }
.form-control:focus, .form-select:focus { border-color: var(--bn-cyan); box-shadow: 0 0 0 .2rem rgba(8, 172, 201, .2); }
:focus-visible { outline: 3px solid var(--bn-cyan); outline-offset: 2px; }
/* Skip link: hidden by clipping, not by moving it 9999px off-screen — in Arabic (RTL) that offset became a 9999px horizontal scroll (found by the RTL suite). */
.skip-link { position: absolute; inset-inline-start: 8px; top: 0; z-index: 2000; background: var(--bn-gold); color: #000; padding: 8px 12px; }
.skip-link:not(:focus) { clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; padding: 0; white-space: nowrap; }

/* ---------- App shell ---------- */
/* minmax(0, 1fr): the content column never grows wider than the screen; wide tables and tab bars scroll inside .bn-main (found by the RTL/layout suite at 390 px). */
.bn-shell { display: grid; grid-template-columns: 76px minmax(0, 1fr); grid-template-rows: 56px 1fr; height: 100vh; }
.bn-rail { grid-row: 1 / 3; background: var(--bn-navy); display: flex; flex-direction: column; align-items: center; padding: 10px 0; gap: 4px; z-index: 20; }
.bn-rail .bn-logo { width: 40px; height: 40px; margin-bottom: 12px; }
.bn-rail a { width: 60px; padding: 8px 0 6px; border-radius: 10px; color: #b9c6dd; text-decoration: none; display: flex; flex-direction: column; align-items: center; font-size: 10.5px; gap: 2px; text-align: center; line-height: 1.1; }
.bn-rail a i { font-size: 20px; }
.bn-rail a:hover { background: var(--bn-navy-2); color: #fff; }
.bn-rail a.active { background: var(--bn-blue); color: #fff; }
.bn-rail .bn-rail-spacer { flex: 1; }
.bn-topbar { display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--bn-surface); border-bottom: 1px solid var(--bn-border); }
.bn-topbar h1 { font-size: 17px; margin: 0; font-weight: 650; }
.bn-topbar .bn-sim-badge { font-size: 11px; }
.bn-main { overflow: auto; min-width: 0; }
/* Pages use the whole width on every screen (no fixed cap): gutters grow with the viewport; see "Large screens" at the end. */
.bn-page { padding: clamp(14px, 1.4vw, 36px); margin: 0 auto; }
.bn-avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 600; flex: none; }
.bn-avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.bn-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: var(--bn-surface-2); border: 1px solid var(--bn-border); color: var(--bn-muted); white-space: nowrap; }
.bn-chip.ai { background: rgba(109, 77, 216, .1); color: var(--bn-ai-text); border-color: rgba(109, 77, 216, .25); }
.bn-chip.sim { background: rgba(187, 154, 40, .12); color: var(--bn-sim-text); border-color: rgba(187, 154, 40, .35); }
.bn-chip.neg { background: rgba(194, 65, 12, .1); color: var(--bn-danger-text); border-color: rgba(194, 65, 12, .25); }
.bn-chip.pos { background: rgba(26, 143, 90, .1); color: var(--bn-ok-text); border-color: rgba(26, 143, 90, .25); }
.bn-chip.high { background: #a3330a; color: #fff; border-color: #a3330a; }
.bn-ch { width: 20px; height: 20px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; flex: none; }
.bn-ch.WhatsApp { background: #1FA855; } .bn-ch.Messenger { background: #0A7CFF; } .bn-ch.Instagram { background: #D62976; }
.bn-ch.WebChat { background: var(--bn-blue); } .bn-ch.Email { background: var(--bn-gold); } .bn-ch.Sms { background: #6B7280; } .bn-ch.Telegram { background: #229ED9; } .bn-ch.Viber { background: #7360F2; } .bn-ch.Line { background: #06C755; } .bn-ch.TikTok { background: #111111; } .bn-ch.WeChat { background: #07C160; } .bn-ch.Custom { background: #475569; }
.bn-empty { text-align: center; color: var(--bn-muted); padding: 48px 16px; }
.bn-empty i { font-size: 40px; display: block; margin-bottom: 8px; color: var(--bn-cyan); }

/* ---------- Inbox ---------- */
.bn-inbox { display: grid; grid-template-columns: 200px 340px 1fr 320px; height: calc(100vh - 56px); }
.bn-col { border-inline-end: 1px solid var(--bn-border); overflow: auto; background: var(--bn-surface); min-width: 0; }
.bn-views a { display: flex; justify-content: space-between; padding: 8px 14px; color: var(--bn-text); text-decoration: none; border-radius: 8px; margin: 2px 8px; font-size: 14px; }
.bn-views a.active, .bn-views a:hover { background: rgba(5, 75, 169, .08); color: var(--bn-blue); }
.bn-views .count { font-size: 12px; color: var(--bn-muted); }
.bn-conv { padding: 12px 14px; border-bottom: 1px solid var(--bn-border); cursor: pointer; display: flex; gap: 10px; }
.bn-conv:hover { background: var(--bn-surface-2); }
.bn-conv.active { background: rgba(5, 75, 169, .07); box-shadow: inset 3px 0 0 var(--bn-blue); }
[dir="rtl"] .bn-conv.active { box-shadow: inset -3px 0 0 var(--bn-blue); }
.bn-conv .name { font-weight: 600; font-size: 14px; }
.bn-conv .preview { font-size: 13px; color: var(--bn-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bn-conv .unread { background: var(--bn-cyan); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 7px; }
.bn-thread { display: flex; flex-direction: column; height: 100%; background: var(--bn-bg); }
.bn-thread-head { padding: 10px 16px; background: var(--bn-surface); border-bottom: 1px solid var(--bn-border); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bn-messages { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.bn-msg { max-width: 72%; padding: 8px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; box-shadow: 0 1px 1px rgba(0,0,0,.04); }
.bn-msg.in { align-self: flex-start; background: var(--bn-surface); border: 1px solid var(--bn-border); border-end-start-radius: 4px; }
.bn-msg.out { align-self: flex-end; background: var(--bn-blue); color: #fff; border-end-end-radius: 4px; }
.bn-msg.out.ai { background: var(--bn-ai); }
.bn-msg.note { align-self: center; background: #fff7dd; border: 1px dashed var(--bn-gold); color: #5b4708; max-width: 80%; }
.bn-msg.system { align-self: center; background: transparent; color: var(--bn-muted); font-size: 12px; box-shadow: none; padding: 2px 8px; }
.bn-msg .meta { font-size: 11px; opacity: .75; margin-top: 3px; display: flex; gap: 6px; justify-content: flex-end; }
.bn-msg.failed { outline: 2px solid var(--bn-danger); }
.bn-composer { background: var(--bn-surface); border-top: 1px solid var(--bn-border); padding: 10px 12px; }
.bn-composer textarea { resize: none; }
.bn-composer.note textarea { background: #fffbea; }
.bn-lock { font-size: 12px; color: var(--bn-warn); }
.bn-side { padding: 16px; }
.bn-side h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--bn-muted); margin: 18px 0 8px; }
.bn-kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 8px; font-size: 13.5px; }
.bn-kv dt { color: var(--bn-muted); font-weight: 400; }
.bn-kv dd { margin: 0; word-break: break-word; }
.bn-back { display: none; }

/* ---------- Simulator ---------- */
.bn-phone { width: 340px; height: 640px; border-radius: 36px; background: #111; padding: 12px; box-shadow: var(--bn-shadow); flex: none; }
.bn-screen { background: #ece5dd; border-radius: 26px; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.bn-screen.Messenger, .bn-screen.Instagram { background: #fff; }
.bn-screen header { color: #fff; padding: 12px 14px; display: flex; gap: 10px; align-items: center; font-size: 14px; }
.bn-screen.WhatsApp header { background: #1F7A55; } .bn-screen.Messenger header { background: #0A7CFF; } .bn-screen.Instagram header { background: linear-gradient(90deg, #833ab4, #d62976, #fcb045); }
.bn-screen .feed { flex: 1; overflow: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.bn-bubble { max-width: 80%; padding: 6px 10px; border-radius: 10px; font-size: 13.5px; white-space: pre-wrap; background: #fff; color: #111; align-self: flex-start; }
.bn-bubble.me { align-self: flex-end; background: #d9fdd3; }
.bn-screen.Messenger .bn-bubble.me { background: #0A7CFF; color: #fff; }
.bn-screen.Instagram .bn-bubble.me { background: #7c3aed; color: #fff; }
.bn-bubble .t { font-size: 10px; color: #667; text-align: end; }
.bn-screen.Messenger .bn-bubble.me .t, .bn-screen.Instagram .bn-bubble.me .t { color: #e5e7ff; }
.bn-screen footer { display: flex; gap: 6px; padding: 8px; background: rgba(255,255,255,.8); }
.bn-typing { font-size: 12px; color: #667; padding: 0 12px 6px; }

/* ---------- Auth / landing ---------- */
.bn-auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.bn-auth .hero { background: radial-gradient(1200px 600px at -10% -10%, rgba(8,172,201,.35), transparent 60%), linear-gradient(160deg, var(--bn-navy) 0%, #0d2b5c 60%, var(--bn-blue) 100%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.bn-auth .hero h2 { font-size: 38px; font-weight: 700; line-height: 1.15; max-width: 520px; }
.bn-auth .hero .gold { color: #e3c868; }
.bn-auth .hero ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; max-width: 520px; }
.bn-auth .hero li { display: flex; gap: 12px; align-items: flex-start; color: #d5e2f5; }
.bn-auth .hero li i { color: var(--bn-cyan); font-size: 20px; }
.bn-auth .panel { display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.bn-auth form { width: 100%; max-width: 420px; }

/* ---------- Help drawer ---------- */
.bn-help h4 { font-size: 14px; margin-top: 18px; color: var(--bn-blue); }
.bn-help .dos li::marker { content: "✓  "; color: var(--bn-ok); }
.bn-help .donts li::marker { content: "✗  "; color: var(--bn-danger); }
.bn-help img { max-width: 100%; border: 1px solid var(--bn-border); border-radius: 8px; }
.toast-container { z-index: 2000; }

/* ---------- Responsive (tablet / mobile / Capacitor app) ---------- */
@media (max-width: 1200px) { .bn-inbox { grid-template-columns: 300px 1fr 260px; } .bn-inbox .bn-views-col { display: none; } }
@media (max-width: 1100px) { .bn-inbox { grid-template-columns: 300px 1fr; } .bn-inbox .bn-side-col { display: none; } }
@media (max-width: 991px) {
  .bn-inbox { grid-template-columns: 1fr; }
  .bn-inbox .bn-side-col { display: none; }
  .bn-inbox.has-active .bn-list-col { display: none; }
  .bn-inbox:not(.has-active) .bn-thread-col { display: none; }
  .bn-back { display: inline-flex; }
  .bn-auth { grid-template-columns: 1fr; } .bn-auth .hero { padding: 28px 20px; } .bn-auth .hero h2 { font-size: 26px; } .bn-auth .hero ul { display: none; }
}
@media (max-width: 767px) {
  .bn-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: 52px 1fr 60px; }
  .bn-rail { grid-row: 3; grid-column: 1; flex-direction: row; justify-content: space-around; padding: 4px 4px env(safe-area-inset-bottom); overflow-x: auto; }
  .bn-rail .bn-logo, .bn-rail .bn-rail-spacer { display: none; }
  .bn-rail a { width: auto; min-width: 56px; padding: 6px 4px; }
  .bn-topbar { grid-row: 1; padding: 0 12px; }
  .bn-main { grid-row: 2; }
  .bn-inbox { height: calc(100vh - 112px); }
  .bn-page { padding: 14px; }
  .bn-msg { max-width: 88%; }
  .bn-phone { width: 100%; max-width: 340px; height: 560px; }
}

.min-w-0 { min-width: 0; }
.flex-none { flex: none; }
.bn-conv > div { min-width: 0; }
/* Each message/preview takes its own direction from its first strong character (English inside Arabic UI and vice versa). */
.bn-msg, .bn-bubble, .w-msg, .bn-conv .preview, .bn-conv .name, #th-name { unicode-bidi: plaintext; }
.bn-shell { overflow: hidden; }
.bn-screen.Email, .bn-screen.Sms { background: #fff; }
.bn-screen.Email header { background: var(--bn-gold); }
.bn-screen.Sms header { background: #4b5563; }
.bn-screen.Sms .bn-bubble.me { background: #2563eb; color: #fff; }
.bn-screen.Sms .bn-bubble.me .t { color: #ffffff; }

/* ---------- Slice 3: pipeline board, KPI tiles, bars, campaigns ---------- */
.bn-tabs { border-bottom: 1px solid var(--bn-border); margin-bottom: 16px; flex-wrap: nowrap; overflow-x: auto; }
.bn-tabs .nav-link { color: var(--bn-muted); white-space: nowrap; }
.bn-tabs .nav-link.active { color: var(--bn-blue); background: transparent; border-color: var(--bn-border) var(--bn-border) var(--bn-surface); font-weight: 600; }
.bn-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; min-height: 360px; }
.bn-col { background: var(--bn-surface-2); border: 1px solid var(--bn-border); border-radius: var(--bn-radius); display: flex; flex-direction: column; min-width: 0; }
.bn-col.drop { outline: 2px dashed var(--bn-cyan); outline-offset: -4px; }
.bn-col-head { padding: 10px 12px; border-bottom: 1px solid var(--bn-border); }
.bn-col-head .small { color: var(--bn-muted); }
.bn-col.won .bn-col-head { border-top: 3px solid var(--bn-ok); border-radius: var(--bn-radius) var(--bn-radius) 0 0; }
.bn-col.lost .bn-col-head { border-top: 3px solid var(--bn-danger); border-radius: var(--bn-radius) var(--bn-radius) 0 0; }
.bn-col-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: 62vh; }
.bn-deal { background: var(--bn-surface); border: 1px solid var(--bn-border); border-radius: 10px; padding: 8px 10px; cursor: grab; text-align: start; width: 100%; color: var(--bn-text); }
.bn-deal:hover { border-color: var(--bn-cyan); }
.bn-deal .amt { font-weight: 650; }
.bn-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.bn-kpi { background: var(--bn-surface); border: 1px solid var(--bn-border); border-radius: var(--bn-radius); padding: 12px 14px; text-align: start; color: var(--bn-text); width: 100%; }
button.bn-kpi:hover { border-color: var(--bn-cyan); }
.bn-kpi .lbl { font-size: 12px; color: var(--bn-muted); }
.bn-kpi .val { font-size: 22px; font-weight: 700; line-height: 1.2; unicode-bidi: plaintext; }
.bn-kpi .sub { font-size: 12px; color: var(--bn-muted); }
.bn-bars .bn-bar-row { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 4px 2px; color: var(--bn-text); text-align: start; border-radius: 6px; }
.bn-bars button.bn-bar-row:hover { background: var(--bn-surface-2); }
.bn-bar-track { height: 10px; background: var(--bn-surface-2); border-radius: 6px; overflow: hidden; border: 1px solid var(--bn-border); }
.bn-bar-fill { display: block; height: 100%; background: var(--bn-blue); border-radius: 6px; }
.bn-bar-val { font-variant-numeric: tabular-nums; font-size: 13px; min-width: 3ch; text-align: end; }
.bn-picker { max-height: 220px; overflow-y: auto; }
.bn-chip.ok { background: rgba(26, 143, 90, .12); color: var(--bn-ok-text); }
.bn-chip.warn { background: rgba(183, 121, 31, .14); color: var(--bn-warn-text); }
.bn-chip.bad { background: rgba(194, 65, 12, .12); color: var(--bn-danger-text); }
.bn-chip.info { background: rgba(5, 75, 169, .1); color: var(--bn-info-text); }
.bn-rule-row { display: grid; grid-template-columns: 1.2fr 1fr 1.4fr auto; gap: 6px; margin-bottom: 6px; }
.bn-quote-lines input { min-width: 70px; }
@media (max-width: 767.98px) {
  .bn-board { grid-auto-columns: 84%; }
  .bn-rule-row { grid-template-columns: 1fr 1fr; }
}
@media print {
  .bn-rail, .bn-topbar, .modal-header .btn-close, .no-print { display: none !important; }
}

/* Accessibility (track QA, axe-core WCAG 2.1 AA): secondary outline buttons, muted text and Bootstrap text utilities keep 4.5:1. */
.btn-outline-secondary { --bs-btn-color: var(--bn-muted); --bs-btn-border-color: var(--bn-border); --bs-btn-hover-color: var(--bn-text); --bs-btn-hover-bg: var(--bn-surface-2); --bs-btn-hover-border-color: var(--bn-muted); }
.btn-light { --bs-btn-color: var(--bn-text); --bs-btn-bg: var(--bn-surface-2); --bs-btn-border-color: var(--bn-border); }
.text-success { color: var(--bn-ok-text) !important; }
.text-warning { color: var(--bn-warn-text) !important; }
.text-danger { color: var(--bn-danger-text) !important; }
.text-primary { color: var(--bn-info-text) !important; }
.text-secondary, .text-body-secondary { color: var(--bn-muted) !important; }
.table { --bs-table-color: var(--bn-text); --bs-table-bg: transparent; --bs-table-striped-color: var(--bn-text); --bs-table-hover-color: var(--bn-text); }
.nav-link { color: var(--bn-info-text); }
.nav-pills .nav-link.active { background: var(--bn-blue); color: #fff; }
.nav-tabs .nav-link.active { color: var(--bn-text); background: var(--bn-surface); }
.dropdown-menu { --bs-dropdown-bg: var(--bn-surface); --bs-dropdown-color: var(--bn-text); --bs-dropdown-link-color: var(--bn-text); --bs-dropdown-header-color: var(--bn-muted); }
.btn-outline-primary { --bs-btn-color: var(--bn-info-text); --bs-btn-border-color: var(--bn-info-text); --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff; }
.btn-outline-danger { --bs-btn-color: var(--bn-danger-text); --bs-btn-border-color: var(--bn-danger-text); --bs-btn-hover-color: #fff; }
.bn-views a.active, .bn-views a:hover { color: var(--bn-info-text); }
/* Avatars use per-person colours with white initials; a dark overlay keeps 4.5:1 whatever the colour. */
.bn-avatar { background-image: linear-gradient(rgba(0, 0, 0, .38), rgba(0, 0, 0, .38)); }
.alert-light { --bs-alert-bg: var(--bn-surface-2); --bs-alert-color: var(--bn-text); --bs-alert-border-color: var(--bn-border); }
.alert a { color: inherit; text-decoration: underline; }

/* ---------- Dashboards, charts and drill-down ---------- */
/* Categorical order validated with the dataviz checks (lightness band, chroma, CVD separation, contrast); dark mode has its own steps. */
:root { --bn-c1: #1F5FC4; --bn-c2: #C99A1E; --bn-c3: #0A9BB8; --bn-c4: #7A4FD0; --bn-c5: #1E9A50; --bn-c6: #C23D86; --bn-prev: #8d99ad; --bn-gold-brand: #E0BE45; --bn-cyan-2: #2CCBE6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bn-c1: #4F8FF0; --bn-c2: #B8902A; --bn-c3: #1AA3BF; --bn-c4: #A27FF0; --bn-c5: #2A9F58; --bn-c6: #E0609E; --bn-prev: #6f7d94; } }
:root[data-theme="dark"] { --bn-c1: #4F8FF0; --bn-c2: #B8902A; --bn-c3: #1AA3BF; --bn-c4: #A27FF0; --bn-c5: #2A9F58; --bn-c6: #E0609E; --bn-prev: #6f7d94; }
.bn-svg { display: block; max-width: 100%; overflow: visible; }
.bn-svg .grid { stroke: var(--bn-border); stroke-width: 1; stroke-dasharray: 2 4; }
.bn-svg .base { stroke: var(--bn-muted); stroke-width: 1; opacity: .5; }
.bn-svg .ax { fill: var(--bn-muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.bn-svg .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.bn-svg .line.prev { stroke-dasharray: 5 4; stroke-width: 1.6; }
.bn-svg .dot { stroke: var(--bn-surface); stroke-width: 1.5; pointer-events: none; }
.bn-svg .hit { fill: transparent; cursor: default; }
.bn-svg .hit[data-drill] { cursor: pointer; }
.bn-svg .hit:hover, .bn-svg .hit:focus { fill: var(--bn-text); fill-opacity: .05; outline: none; }
.bn-svg .bar { pointer-events: none; }
.bn-svg .slice { stroke: var(--bn-surface); stroke-width: 2; cursor: pointer; transition: opacity .15s; }
.bn-svg .slice:hover, .bn-svg .slice:focus { opacity: .82; outline: none; }
.bn-svg .slice:focus-visible, .bn-svg .cell:focus-visible, .bn-svg .hit:focus-visible { stroke: var(--bn-cyan); stroke-width: 3; }
.bn-svg .cell { cursor: pointer; }
.bn-svg .cell:hover { stroke: var(--bn-text); stroke-width: 1; }
.bn-svg .dc-v { font-size: 20px; font-weight: 700; fill: var(--bn-text); }
.bn-svg .dc-l { font-size: 11px; fill: var(--bn-muted); }
.bn-chart-empty { color: var(--bn-muted); font-size: 13px; padding: 28px 8px; text-align: center; }
.bn-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; padding: 0; margin: 6px 0 0; font-size: 12px; color: var(--bn-muted); }
.bn-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-inline-end: 6px; }
.bn-legend i.dashed { background: none !important; border-top: 2px dashed; height: 0; }
.bn-chart-table { margin-top: 6px; font-size: 12px; }
.bn-chart-table summary { color: var(--bn-muted); cursor: pointer; width: max-content; }
.bn-chart-table .table-responsive { max-height: 240px; overflow: auto; }
.bn-tip { position: fixed; z-index: 3000; pointer-events: none; background: var(--bn-navy); color: #fff; border-radius: 8px; padding: 6px 9px; font-size: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.25); opacity: 0; transition: opacity .1s; max-width: 280px; }
.bn-tip.show { opacity: 1; }
.bn-tip-t { font-weight: 600; margin-bottom: 2px; }
.bn-tip-r { display: flex; gap: 8px; align-items: center; } .bn-tip-r span { flex: 1; opacity: .85; } .bn-tip-r b { font-variant-numeric: tabular-nums; }
.bn-tip-r i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.bn-hbars { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.bn-hbar { display: grid; grid-template-columns: minmax(70px, 34%) 1fr auto; align-items: center; gap: 10px; width: 100%; background: none; border: 0; padding: 5px 4px; color: var(--bn-text); text-align: start; border-radius: 8px; font-size: 13px; }
button.bn-hbar:hover, button.bn-hbar:focus-visible { background: var(--bn-surface-2); }
.bn-hbar .trk { height: 10px; background: var(--bn-surface-2); border-radius: 0 4px 4px 0; overflow: hidden; }
[dir="rtl"] .bn-hbar .trk { border-radius: 4px 0 0 4px; }
.bn-hbar .fill { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--bn-c1); }
[dir="rtl"] .bn-hbar .fill { border-radius: 4px 0 0 4px; }
.bn-hbar .val { font-variant-numeric: tabular-nums; text-align: end; white-space: nowrap; font-size: 12.5px; }
.bn-hbar .val .amt { display: block; font-size: 11px; color: var(--bn-muted); }
.bn-donut { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.bn-dlegend { list-style: none; padding: 0; margin: 0; flex: 1; min-width: 150px; display: grid; gap: 4px; font-size: 12.5px; }
.bn-dlegend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 36px; gap: 8px; align-items: center; }
.bn-dlegend i { width: 10px; height: 10px; border-radius: 3px; }
.bn-dlegend b { font-variant-numeric: tabular-nums; font-weight: 600; } .bn-dlegend .pct { color: var(--bn-muted); text-align: end; }
.bn-funnel { list-style: none; padding: 0; margin: 0; }
.bn-funnel .step { display: block; position: relative; width: 100%; background: none; border: 0; padding: 0; height: 34px; color: var(--bn-text); text-align: center; border-radius: 8px; }
.bn-funnel .bar { position: absolute; inset-block: 2px; inset-inline-start: 50%; transform: translateX(-50%); border-radius: 6px; }
[dir="rtl"] .bn-funnel .bar { transform: translateX(50%); }
.bn-funnel .txt { position: relative; display: flex; justify-content: space-between; align-items: center; height: 100%; padding: 0 10px; font-size: 13px; }
.bn-funnel .txt span, .bn-funnel .txt b { background: var(--bn-surface); padding: 1px 6px; border-radius: 4px; }
.bn-funnel button.step:hover .bar, .bn-funnel button.step:focus-visible .bar { filter: brightness(1.08); outline: 2px solid var(--bn-cyan); }
.bn-funnel .conv { font-size: 11px; color: var(--bn-muted); text-align: center; line-height: 1; margin: 1px 0; }
.bn-scale { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--bn-muted); margin-top: 4px; justify-content: flex-end; }
.bn-scale i { width: 90px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, color-mix(in srgb, var(--bn-c1) 14%, transparent), var(--bn-c1)); }
[dir="rtl"] .bn-scale i { background: linear-gradient(270deg, color-mix(in srgb, var(--bn-c1) 14%, transparent), var(--bn-c1)); }
.bn-gauge { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bn-gauge .dc-v { font-size: 22px; }
.bn-spark { display: block; }

/* Dashboard layout */
.bn-dash-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 16px; }
.bn-dash-head .bn-period .btn { min-width: 46px; }
.bn-kpis.dash { grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); }
.bn-kpi.k2 { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto auto; column-gap: 8px; position: relative; overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .15s; }
.bn-kpi.k2::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 3px; background: var(--k-accent, var(--bn-c1)); }
button.bn-kpi.k2:hover, button.bn-kpi.k2:focus-visible { border-color: var(--bn-cyan); box-shadow: var(--bn-shadow); transform: translateY(-1px); }
.bn-kpi.k2 .lbl { grid-column: 1 / 3; display: flex; align-items: center; gap: 6px; } .bn-kpi.k2 .lbl i { color: var(--k-accent, var(--bn-c1)); }
.bn-kpi.k2 .val { grid-column: 1; align-self: end; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bn-kpi.k2 .spk { grid-column: 2; grid-row: 2; align-self: end; } .bn-kpi.k2 .spk svg { width: 72px; }
.bn-kpi.k2 .sub { grid-column: 1 / 3; margin-top: 4px; min-height: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.bn-delta { font-size: 11.5px; font-weight: 600; padding: 0 6px; border-radius: 999px; white-space: nowrap; }
.bn-delta.up { color: var(--bn-ok-text); background: rgba(26, 143, 90, .12); } .bn-delta.down { color: var(--bn-danger-text); background: rgba(194, 65, 12, .1); } .bn-delta.flat { color: var(--bn-muted); background: var(--bn-surface-2); }
.bn-panel { background: var(--bn-surface); border: 1px solid var(--bn-border); border-radius: var(--bn-radius); box-shadow: var(--bn-shadow); padding: 14px 16px; height: 100%; min-width: 0; }
.bn-panel > header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.bn-panel > header h2 { font-size: 14px; font-weight: 650; margin: 0; }
.bn-panel > header .act { margin-inline-start: auto; display: flex; gap: 4px; align-items: center; }
.bn-panel .hint { font-size: 11.5px; color: var(--bn-muted); }
.bn-hero { background: radial-gradient(900px 300px at 0% -40%, rgba(8, 172, 201, .28), transparent 60%), linear-gradient(120deg, var(--bn-navy), #0d2b5c 70%, var(--bn-blue)); color: #fff; border-radius: var(--bn-radius); padding: 16px 20px; margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; }
.bn-hero h2 { font-size: 18px; margin: 0; font-weight: 650; } .bn-hero .sub { color: #c8d6ee; font-size: 13px; }
.bn-hero .gold { color: var(--bn-gold-brand); }
.bn-board-table td, .bn-board-table th { white-space: nowrap; }
.bn-board-table tr[data-drill] { cursor: pointer; }
.bn-medal { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; background: var(--bn-surface-2); color: var(--bn-muted); }
.bn-medal.m1 { background: var(--bn-gold-brand); color: #3d3000; } .bn-medal.m2 { background: #cfd8e3; color: #2b3647; } .bn-medal.m3 { background: #e2b48a; color: #4a2a0d; }
/* List summary chips (contacts, campaigns, pipeline) */
.bn-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.bn-summary .bn-sum-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--bn-border); background: var(--bn-surface); color: var(--bn-text); border-radius: 999px; padding: 3px 4px 3px 10px; font-size: 12.5px; }
[dir="rtl"] .bn-summary .bn-sum-chip { padding: 3px 10px 3px 4px; }
.bn-summary .bn-sum-chip.active { border-color: var(--bn-blue); background: rgba(5, 75, 169, .08); color: var(--bn-info-text); }
.bn-summary .bn-sum-chip b { font-variant-numeric: tabular-nums; background: var(--bn-surface-2); border-radius: 999px; padding: 0 7px; }
.bn-summary .bn-sum-chip .mini { width: 34px; height: 6px; border-radius: 3px; background: var(--bn-surface-2); overflow: hidden; }
.bn-summary .bn-sum-chip .mini span { display: block; height: 100%; background: var(--bn-c1); }
.bn-summary .bn-sum-drill { border: 0; background: none; color: var(--bn-muted); padding: 0 4px; border-radius: 50%; }
.bn-summary .bn-sum-drill:hover { color: var(--bn-info-text); }
/* Drill-down panel: sized by its data, never more than 90% of the viewport in either axis */
.bn-drill-wrap { position: fixed; inset: 0; z-index: 1900; display: flex; align-items: center; justify-content: center; }
.bn-drill-wrap[hidden] { display: none; }
.bn-drill-backdrop { position: absolute; inset: 0; background: rgba(6, 14, 30, .5); }
.bn-drill { position: relative; display: flex; flex-direction: column; background: var(--bn-surface); color: var(--bn-text); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.35); max-width: 90vw; max-height: 90vh; width: 520px; overflow: hidden; outline: none; animation: bn-pop .16s ease-out; }
@keyframes bn-pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bn-drill { animation: none; } .bn-kpi.k2 { transition: none; } }
.bn-drill-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--bn-border); }
.bn-crumbs { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0 0 2px; font-size: 11.5px; color: var(--bn-muted); }
.bn-crumbs li + li::before { content: "›"; margin-inline-end: 4px; }
[dir="rtl"] .bn-crumbs li + li::before { content: "‹"; }
.bn-crumbs .btn-link { font-size: 11.5px; vertical-align: baseline; }
.bn-drill-tools:not(:empty) { padding: 10px 14px; border-bottom: 1px solid var(--bn-border); }
.bn-drill-body { overflow: auto; flex: 1 1 auto; min-height: 0; padding: 6px 8px; }
.bn-drill-foot:not(:empty) { padding: 8px 14px; border-top: 1px solid var(--bn-border); }
.bn-drill-table thead th { position: sticky; top: 0; background: var(--bn-surface); z-index: 1; }
.bn-sort { background: none; border: 0; padding: 0; color: inherit; font-weight: 600; white-space: nowrap; }
.bn-sort i { opacity: .5; font-size: 10px; }
body.bn-drill-open { overflow: hidden; }
@media (max-width: 767px) {
  .bn-kpis.dash { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .bn-kpi.k2 { padding: 10px; } .bn-kpi.k2 .spk { display: none; } .bn-kpi.k2 .val { font-size: 18px; }
  .bn-hbar { grid-template-columns: minmax(60px, 38%) 1fr auto; gap: 6px; }
  .bn-drill-head { padding: 10px; }
}

/* ---------- Large screens (27" 2560 px, ultrawide and 4K at 150%) ----------
   Content fills the width; type, controls and chart text step up so a 27" screen reads like a laptop does at arm's length.
   Long-form text (forms, settings, help) keeps a readable measure inside its cards. */
@media (min-width: 1920px) {
  body { font-size: 15px; }
  .bn-topbar h1 { font-size: 19px; }
  .bn-rail a { font-size: 11px; }
  .bn-kpis.dash { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
  .bn-kpi .val { font-size: 1.75rem; }
  .table, .form-control, .form-select, .btn { font-size: .95rem; }
  .bn-msg { font-size: 15px; }
}
@media (min-width: 2400px) {
  body { font-size: 16px; }
  .bn-shell { grid-template-columns: 88px minmax(0, 1fr); grid-template-rows: 64px 1fr; }
  .bn-rail a { width: 72px; font-size: 12px; }
  .bn-rail a i { font-size: 23px; }
  .bn-topbar h1 { font-size: 21px; }
  .bn-kpis.dash { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
  .bn-kpi .val { font-size: 2rem; }
  .table, .form-control, .form-select, .btn, .nav-link, .dropdown-item { font-size: 1rem; }
  .bn-inbox { grid-template-columns: 240px 420px 1fr 380px; height: calc(100vh - 64px); }
  .bn-msg { font-size: 16px; max-width: 64%; }
  .bn-kv { font-size: 15px; }
  .bn-svg text { font-size: 13px; }
}
@media (min-width: 3200px) {
  body { font-size: 18px; }
  .bn-kpis.dash { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
  .table, .form-control, .form-select, .btn, .nav-link, .dropdown-item { font-size: 1.1rem; }
}

/* KPI tiles size their content to the tile itself (container queries), so long values such as "AED 104,450.00" are never cut off:
   narrow tiles drop the sparkline and the value scales with the tile width. */
.bn-kpi.k2 { container-type: inline-size; }
.bn-kpi.k2 .val { font-size: clamp(16px, 12cqi, 1.75rem); }
@container (max-width: 230px) {
  .bn-kpi.k2 .spk { display: none; }
  .bn-kpi.k2 .val { font-size: clamp(16px, 14cqi, 24px); }
}

/* Pages built on Bootstrap's .container (landing, status, widget demo): grow past Bootstrap's 1320 px cap on large screens. */
@media (min-width: 1600px) { .container { max-width: 1520px; } }
@media (min-width: 2000px) { .container { max-width: 1840px; } }
@media (min-width: 2400px) { .container { max-width: 2240px; } }
@media (min-width: 3200px) { .container { max-width: 2960px; } }
/* Sign-in / sign-up / invite: the brand panel's text scales with large screens. */
@media (min-width: 2400px) {
  .bn-auth .hero { padding: 80px; } .bn-auth .hero h2 { font-size: 56px; max-width: 760px; } .bn-auth .hero ul { max-width: 760px; gap: 20px; font-size: 20px; } .bn-auth .hero li i { font-size: 26px; }
  .bn-auth form { max-width: 560px; } .bn-auth .panel { font-size: 18px; }
}
/* Text pages (status and trust): a readable column that widens and scales on large screens. */
.container.bn-readable { max-width: 960px; }
@media (min-width: 2000px) { .container.bn-readable { max-width: 1280px; font-size: 17px; } }
@media (min-width: 2400px) { .container.bn-readable { max-width: 1500px; font-size: 19px; } }
@media (min-width: 3200px) { .container.bn-readable { max-width: 1900px; font-size: 23px; } }
