/* =========================================================================
   Busiverse Brain Portal — design tokens
   Direction: framed device-mockup on a vivid violet/magenta gradient,
   dark near-black interior, saturated gradient accent tiles (violet,
   amber, azure), generous rounding. Louder and more consumer-facing
   than the earlier instrument-panel pass — a deliberate style swap,
   not an evolution of it.
   ========================================================================= */

:root {
    --bp-ink:        #14101F;
    --bp-ink-2:      #1A1428;
    --bp-panel:      rgba(32, 24, 48, 0.6);
    --bp-panel-solid:#1E1730;
    --bp-panel-2:    rgba(255, 255, 255, 0.05);
    --bp-line:       rgba(255, 255, 255, 0.09);
    --bp-line-soft:  rgba(255, 255, 255, 0.06);
    --bp-text:       #F5F2FA;
    --bp-muted:      #A79FC0;
    --bp-faint:      #6E6690;

    --bp-signal:     #A855F7;
    --bp-signal-dim: rgba(168, 85, 247, 0.18);
    --bp-azure:      #4F8EF7;
    --bp-azure-dim:  rgba(79, 142, 247, 0.18);
    --bp-alert:      #F59E42;
    --bp-alert-dim:  rgba(245, 158, 66, 0.18);
    --bp-critical:   #FB5B84;
    --bp-critical-dim: rgba(251, 91, 132, 0.18);
    --bp-good:       #34D399;
    --bp-good-dim:   rgba(52, 211, 153, 0.16);

    --bp-font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
    --bp-font-body:    'Inter', 'Segoe UI', sans-serif;
    --bp-font-mono:    'JetBrains Mono', 'Consolas', monospace;

    --bp-radius:    20px;
    --bp-radius-sm: 14px;
    --bp-blur:      18px;
    --bp-side-w:    252px;
    --bp-frame-pad: 22px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    color: var(--bp-text);
    font-family: var(--bp-font-body);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: #8B3FE0;
background-image: radial-gradient(1200px 800px at 15% 0%, rgb(31 10 35 / 85%), transparent 55%), radial-gradient(1100px 900px at 95% 100%, rgb(37 28 52 / 90%), transparent 60%), linear-gradient(150deg, #000000 0%, #2b094a 45%, #1b0f2e 100%);    background-attachment: fixed;
    background-repeat: no-repeat;
    padding: var(--bp-frame-pad);
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
table { border-collapse: collapse; width: 100%; }

/* ---------------------------------------------------------------------
   Shell layout — framed "device mockup" on the gradient backdrop
   --------------------------------------------------------------------- */

.bp-shell {
    display: grid;
    grid-template-columns: var(--bp-side-w) 1fr;
    min-height: calc(100vh - (var(--bp-frame-pad) * 2));
    background: var(--bp-ink);
    border-radius: 26px;
    overflow: hidden;
    box-shadow: 0 50px 120px rgba(20, 6, 40, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* ---------------------------------------------------------------------
   Sidebar / menu
   --------------------------------------------------------------------- */

.bp-side {
    background: rgba(18, 12, 30, 0.65);
    backdrop-filter: blur(var(--bp-blur));
    -webkit-backdrop-filter: blur(var(--bp-blur));
    border-right: 1px solid var(--bp-line);
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    position: sticky;
    top: 0;
    height: 100%;
    transition: margin-left .2s ease;
}

.bp-shell.bp-collapsed .bp-side { margin-left: calc(-1 * var(--bp-side-w)); }

.bp-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 22px 8px;
}

.bp-logo-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--bp-signal), #6D28D9);
    color: #1B0F33;
    font-family: var(--bp-font-display);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.5px;
    box-shadow: 0 6px 18px rgba(168, 85, 247, 0.35);
}

.bp-logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.bp-logo-title { font-family: var(--bp-font-display); font-weight: 600; font-size: 15px; }
.bp-logo-sub { font-family: var(--bp-font-mono); font-size: 10px; letter-spacing: 1.5px; color: var(--bp-faint); }

.bp-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }

.bp-nav-item, .bp-nav-parent {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border: none;
    background: transparent;
    color: var(--bp-muted);
    font-family: var(--bp-font-body);
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
}

.bp-nav-item:hover, .bp-nav-parent:hover { background: var(--bp-panel-2); color: var(--bp-text); }
.bp-nav-item.is-active {
    background: var(--bp-signal-dim);
    color: var(--bp-signal);
    box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.25);
}

.bp-ico { width: 16px; text-align: center; opacity: 0.85; font-size: 13px; }

.bp-nav-parent { justify-content: space-between; }
.bp-chevron { transition: transform .15s ease; color: var(--bp-faint); }
.bp-nav-group.is-open .bp-chevron { transform: rotate(90deg); }

.bp-nav-children {
    display: none;
    flex-direction: column;
    padding-left: 30px;
    border-left: 1px solid var(--bp-line-soft);
    margin: 2px 0 6px 22px;
}
.bp-nav-group.is-open .bp-nav-children { display: flex; }

.bp-nav-child {
    padding: 6px 8px;
    font-size: 13px;
    color: var(--bp-muted);
    border-radius: 8px;
}
.bp-nav-child:hover { color: var(--bp-signal); background: var(--bp-signal-dim); }
.bp-nav-child.is-active { color: var(--bp-signal); background: var(--bp-signal-dim); font-weight: 600; }

.bp-side-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 12px 4px;
    font-family: var(--bp-font-mono);
    font-size: 11px;
    color: var(--bp-faint);
    border-top: 1px solid var(--bp-line-soft);
    margin-top: 10px;
}

.bp-pulse-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--bp-signal);
    box-shadow: 0 0 0 0 var(--bp-signal-dim);
    animation: bp-pulse-dot 2.2s infinite;
    flex-shrink: 0;
}
@keyframes bp-pulse-dot {
    0%   { box-shadow: 0 0 0 0 rgba(168,85,247,0.5); }
    70%  { box-shadow: 0 0 0 6px rgba(168,85,247,0); }
    100% { box-shadow: 0 0 0 0 rgba(168,85,247,0); }
}

/* ---------------------------------------------------------------------
   Up bar
   --------------------------------------------------------------------- */

.bp-main { display: flex; flex-direction: column; min-width: 0; }

.bp-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 28px;
    border-bottom: 1px solid var(--bp-line);
    background: rgba(5, 7, 12, 0.5);
    backdrop-filter: blur(var(--bp-blur));
    -webkit-backdrop-filter: blur(var(--bp-blur));
    position: sticky;
    top: 0;
    z-index: 5;
}

.bp-burger {
    background: var(--bp-panel-2); border: 1px solid var(--bp-line); color: var(--bp-muted);
    border-radius: 10px; width: 34px; height: 34px; cursor: pointer; font-size: 16px;
    display: none;
}

.bp-search {
    flex: 1;
    max-width: 460px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bp-panel-2);
    border: 1px solid var(--bp-line);
    border-radius: 999px;
    padding: 9px 16px;
}
.bp-search-ico { color: var(--bp-faint); }
.bp-search input {
    background: transparent; border: none; outline: none; color: var(--bp-text);
    font-family: var(--bp-font-body); font-size: 13px; width: 100%;
}
.bp-search input::placeholder { color: var(--bp-faint); }

.bp-top-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }

.bp-datetime {
    font-family: var(--bp-font-mono);
    font-size: 12.5px;
    color: var(--bp-muted);
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.bp-icon-btn {
    position: relative;
    background: var(--bp-panel-2);
    border: 1px solid var(--bp-line);
    border-radius: 50%;
    width: 38px; height: 38px;
    cursor: pointer;
    color: var(--bp-text);
    font-size: 14px;
}
.bp-icon-btn:hover { background: rgba(255,255,255,0.08); }
.bp-badge {
    position: absolute; top: -4px; right: -4px;
    background: var(--bp-critical); color: #200609;
    font-family: var(--bp-font-mono); font-size: 10px; font-weight: 700;
    border-radius: 10px; padding: 1px 5px; line-height: 1.4;
    box-shadow: 0 0 0 2px var(--bp-ink);
}

.bp-account {
    display: flex; align-items: center; gap: 9px; cursor: pointer;
    padding: 4px 10px 4px 4px; border-radius: 999px;
    border: 1px solid transparent;
}
.bp-account:hover { background: var(--bp-panel-2); border-color: var(--bp-line); }
.bp-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, var(--bp-signal-dim), rgba(255,255,255,0.06));
    border: 1px solid var(--bp-line);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--bp-font-mono); font-size: 11.5px; font-weight: 600; color: var(--bp-signal);
}
.bp-account-text { display: flex; flex-direction: column; line-height: 1.2; }
.bp-account-name { font-size: 12.5px; font-weight: 600; }
.bp-account-role { font-size: 11px; color: var(--bp-faint); }

/* ---------------------------------------------------------------------
   Content area
   --------------------------------------------------------------------- */

.bp-content { padding: 26px 28px 60px; }

.bp-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.bp-eyebrow {
    font-family: var(--bp-font-mono);
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--bp-signal);
}

.bp-page-head h1 {
    font-family: var(--bp-font-display);
    font-size: 26px;
    margin: 4px 0 4px;
    font-weight: 600;
}

.bp-subtext { color: var(--bp-muted); font-size: 13.5px; margin: 0; }

/* Signature element: a live pulse strip, the "heartbeat" of the Brain */
.bp-pulse-strip { width: 220px; height: 40px; opacity: 0.9; }
.bp-pulse-svg { width: 100%; height: 100%; }
.bp-pulse-svg polyline {
    fill: none;
    stroke: var(--bp-signal);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 620;
    stroke-dashoffset: 620;
    animation: bp-draw 3.6s ease-in-out infinite;
    filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.55));
}
@keyframes bp-draw {
    0%   { stroke-dashoffset: 620; opacity: .35; }
    45%  { stroke-dashoffset: 0;   opacity: 1; }
    55%  { stroke-dashoffset: 0;   opacity: 1; }
    100% { stroke-dashoffset: -620; opacity: .35; }
}
@media (prefers-reduced-motion: reduce) {
    .bp-pulse-svg polyline { animation: none; stroke-dashoffset: 0; }
    .bp-pulse-dot { animation: none; }
}

/* KPI row */
.bp-kpi-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
.bp-kpi {
    background: var(--bp-panel);
    backdrop-filter: blur(var(--bp-blur));
    -webkit-backdrop-filter: blur(var(--bp-blur));
    border: 1px solid var(--bp-line);
    border-radius: var(--bp-radius-sm);
    padding: 15px 16px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 10px 30px rgba(0,0,0,0.25);
}
.bp-kpi-label { font-size: 11.5px; color: var(--bp-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.bp-kpi-value { font-family: var(--bp-font-mono); font-size: 24px; font-weight: 600; }
.bp-kpi-delta {
    display: inline-flex;
    width: fit-content;
    font-size: 11px;
    font-family: var(--bp-font-mono);
    padding: 2px 9px;
    border-radius: 999px;
}
.bp-kpi-delta.up { color: var(--bp-good); background: var(--bp-good-dim); }
.bp-kpi-delta.down-good { color: var(--bp-good); background: var(--bp-good-dim); }
.bp-kpi-delta.flat { color: var(--bp-faint); background: var(--bp-panel-2); }

/* Grids */
.bp-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.bp-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }

/* Cards */
.bp-card {
    background: var(--bp-panel);
    backdrop-filter: blur(var(--bp-blur));
    -webkit-backdrop-filter: blur(var(--bp-blur));
    border: 1px solid var(--bp-line);
    border-radius: var(--bp-radius);
    padding: 18px 20px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 14px 40px rgba(0,0,0,0.3);
}
.bp-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.bp-card-head h2 { font-family: var(--bp-font-display); font-size: 15px; font-weight: 600; margin: 0; }
.bp-tag {
    font-family: var(--bp-font-mono);
    font-size: 10.5px;
    color: var(--bp-signal);
    background: var(--bp-signal-dim);
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.bp-card-foot { margin: 10px 0 0; font-size: 11.5px; color: var(--bp-faint); font-family: var(--bp-font-mono); }

/* Status list (Knowledge Layers) */
.bp-status-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--bp-line-soft); }
.bp-status-list li:last-child { border-bottom: none; }
.bp-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.bp-dot.ok { background: var(--bp-good); box-shadow: 0 0 8px rgba(52,211,153,0.6); }
.bp-dot.warn { background: var(--bp-alert); box-shadow: 0 0 8px rgba(245,158,66,0.6); }
.bp-dot.err { background: var(--bp-critical); box-shadow: 0 0 8px rgba(251,91,132,0.6); }
.bp-status-name { flex: 1; font-size: 13px; }
.bp-status-meta { font-family: var(--bp-font-mono); font-size: 11px; color: var(--bp-faint); }

/* Skill usage bars */
.bp-skill-list li { padding: 8px 0; }
.bp-skill-name { display: block; font-size: 13px; margin-bottom: 6px; }
.bp-bar-track { background: rgba(255,255,255,0.06); border-radius: 999px; height: 6px; overflow: hidden; }
.bp-bar-fill { background: linear-gradient(90deg, var(--bp-signal), #6D28D9); height: 100%; border-radius: 999px; }

/* Table (Projects) */
.bp-table th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--bp-faint);
    font-weight: 600;
    padding: 0 0 8px;
    border-bottom: 1px solid var(--bp-line);
}
.bp-table td { padding: 10px 0; border-bottom: 1px solid var(--bp-line-soft); font-size: 13px; }
.bp-table tr:last-child td { border-bottom: none; }

.bp-chip {
    font-family: var(--bp-font-mono);
    font-size: 10.5px;
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.stage-build     { background: var(--bp-alert-dim); color: var(--bp-alert); }
.stage-review    { background: rgba(154,164,190,0.14); color: var(--bp-muted); }
.stage-live      { background: var(--bp-good-dim); color: var(--bp-good); }
.stage-discovery { background: rgba(154,164,190,0.14); color: var(--bp-muted); }

/* Feed (Alerts) */
.bp-feed li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--bp-line-soft); }
.bp-feed li:last-child { border-bottom: none; }
.bp-feed-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.sev-high   { background: var(--bp-critical); box-shadow: 0 0 8px rgba(251,91,132,0.6); }
.sev-medium { background: var(--bp-alert); box-shadow: 0 0 8px rgba(245,158,66,0.6); }
.sev-info   { background: var(--bp-signal); box-shadow: 0 0 8px rgba(168,85,247,0.6); }
.bp-feed-body { display: flex; flex-direction: column; gap: 3px; }
.bp-feed-text { font-size: 13px; }
.bp-feed-time { font-family: var(--bp-font-mono); font-size: 11px; color: var(--bp-faint); }

/* Idea Center strip */
.bp-idea-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.bp-idea-strip h2 { font-family: var(--bp-font-display); font-size: 17px; margin: 4px 0 0; font-weight: 600; }

.bp-btn-ghost {
    border: 1px solid var(--bp-signal);
    color: var(--bp-signal);
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}
.bp-btn-ghost:hover { background: var(--bp-signal-dim); }

.bp-btn-solid {
    background: var(--bp-signal);
    color: #1B0F33;
    border: none;
    font-weight: 600;
    padding: 11px 20px;
    border-radius: 999px;
    font-size: 13px;
    cursor: pointer;
    font-family: var(--bp-font-body);
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.3);
}
.bp-btn-solid:hover { opacity: .92; }

/* Focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 2px solid var(--bp-signal);
    outline-offset: 2px;
}

/* =========================================================================
   Shared components for interior pages (Brain sub-pages, Settings, etc.)
   ========================================================================= */

/* Kanban (Idea Center, Projects board) */
.bp-kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.bp-kanban-col {
    background: var(--bp-panel);
    backdrop-filter: blur(var(--bp-blur));
    -webkit-backdrop-filter: blur(var(--bp-blur));
    border: 1px solid var(--bp-line);
    border-radius: var(--bp-radius);
    padding: 14px;
    display: flex; flex-direction: column; gap: 10px;
}
.bp-kanban-col h3 { font-family: var(--bp-font-display); font-size: 12.5px; margin: 0 0 4px; display: flex; justify-content: space-between; align-items: center; color: var(--bp-muted); text-transform: uppercase; letter-spacing: .5px; }
.bp-kanban-count { font-family: var(--bp-font-mono); font-size: 11px; background: var(--bp-panel-2); padding: 2px 9px; border-radius: 999px; color: var(--bp-faint); }
.bp-kanban-card { background: rgba(255,255,255,0.04); border: 1px solid var(--bp-line-soft); border-radius: 12px; padding: 11px 13px; display: flex; flex-direction: column; gap: 6px; }
.bp-kanban-card .bp-kc-title { font-size: 13px; font-weight: 600; }
.bp-kanban-card .bp-kc-meta { font-family: var(--bp-font-mono); font-size: 10.5px; color: var(--bp-faint); }

/* Forms (Settings pages, Customize) */
.bp-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.bp-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.bp-field label { font-size: 11.5px; color: var(--bp-muted); text-transform: uppercase; letter-spacing: .4px; }
.bp-field input, .bp-field select, .bp-field textarea {
    background: rgba(255,255,255,0.04); border: 1px solid var(--bp-line); border-radius: var(--bp-radius-sm);
    padding: 10px 12px; color: var(--bp-text); font-family: var(--bp-font-body); font-size: 13px;
}
.bp-field textarea { resize: vertical; min-height: 90px; font-family: var(--bp-font-mono); }
.bp-field input:focus, .bp-field select:focus, .bp-field textarea:focus { outline: 2px solid var(--bp-signal); outline-offset: 1px; }
.bp-field-hint { font-size: 11px; color: var(--bp-faint); }

/* Toggle rows (Notifications, Reminders) */
.bp-toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--bp-line-soft); gap: 16px; }
.bp-toggle-row:last-child { border-bottom: none; }
.bp-toggle-text .t-name { font-size: 13px; font-weight: 600; display: block; }
.bp-toggle-text .t-desc { font-size: 12px; color: var(--bp-faint); }
.bp-switch { position: relative; width: 38px; height: 22px; flex-shrink: 0; display: inline-block; }
.bp-switch input { opacity: 0; width: 0; height: 0; }
.bp-switch .bp-slider { position: absolute; inset: 0; background: rgba(255,255,255,0.08); border: 1px solid var(--bp-line); border-radius: 999px; transition: .15s; cursor: pointer; }
.bp-switch .bp-slider::before { content: ''; position: absolute; width: 16px; height: 16px; left: 2px; top: 1px; background: var(--bp-faint); border-radius: 50%; transition: .15s; }
.bp-switch input:checked + .bp-slider { background: var(--bp-signal-dim); border-color: var(--bp-signal); }
.bp-switch input:checked + .bp-slider::before { transform: translateX(16px); background: var(--bp-signal); box-shadow: 0 0 8px rgba(168,85,247,0.6); }

/* Department cards */
.bp-dept-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.bp-dept-card {
    background: var(--bp-panel);
    backdrop-filter: blur(var(--bp-blur));
    -webkit-backdrop-filter: blur(var(--bp-blur));
    border: 1px solid var(--bp-line);
    border-radius: var(--bp-radius);
    padding: 18px;
    display: flex; flex-direction: column; gap: 8px;
}
.bp-dept-card h3 { font-family: var(--bp-font-display); font-size: 15px; margin: 0; }
.bp-dept-stat { font-family: var(--bp-font-mono); font-size: 22px; font-weight: 600; }
.bp-dept-label { font-size: 11px; color: var(--bp-faint); text-transform: uppercase; letter-spacing: .4px; }

/* Theme swatches */
.bp-swatch-row { display: flex; gap: 12px; flex-wrap: wrap; }
.bp-swatch { width: 56px; height: 56px; border-radius: 14px; border: 2px solid transparent; cursor: pointer; }
.bp-swatch.is-selected { border-color: var(--bp-signal); box-shadow: 0 0 0 3px var(--bp-signal-dim); }

/* Chat bubbles (shared by full-page + floating panel) */
.bp-chat-bubble { max-width: 78%; padding: 11px 15px; border-radius: 16px; font-size: 13px; line-height: 1.5; }
.bp-chat-bubble.from-user {
    align-self: flex-end;
    background: var(--bp-signal-dim);
    color: var(--bp-text);
    border: 1px solid rgba(168,85,247,0.25);
    border-bottom-right-radius: 4px;
}
.bp-chat-bubble.from-assistant {
    align-self: flex-start;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--bp-line);
    border-bottom-left-radius: 4px;
}
.bp-chat-time { font-family: var(--bp-font-mono); font-size: 10px; color: var(--bp-faint); margin-top: 4px; }

/* Skill / knowledge cards */
.bp-tile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.bp-tile {
    background: var(--bp-panel);
    backdrop-filter: blur(var(--bp-blur));
    -webkit-backdrop-filter: blur(var(--bp-blur));
    border: 1px solid var(--bp-line);
    border-radius: var(--bp-radius);
    padding: 16px;
    display: flex; flex-direction: column; gap: 8px;
}
.bp-tile-top { display: flex; justify-content: space-between; align-items: flex-start; }
.bp-tile h3 { font-family: var(--bp-font-display); font-size: 14px; margin: 0; }
.bp-tile p { font-size: 12.5px; color: var(--bp-muted); margin: 0; line-height: 1.5; }

/* =========================================================================
   Assistant chat — floating launcher (all pages) + full-page variant
   ========================================================================= */

.bp-fab {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 40;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bp-signal), #6D28D9);
    border: none;
    cursor: pointer;
    color: #1B0F33;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.4);
    transition: transform .15s ease;
}
.bp-fab:hover { transform: scale(1.06); }

.bp-fab-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid var(--bp-signal);
    opacity: 0;
    animation: bp-fab-pulse 2.6s infinite;
    pointer-events: none;
}
@keyframes bp-fab-pulse {
    0%   { opacity: .55; transform: scale(0.9); }
    70%  { opacity: 0;   transform: scale(1.3); }
    100% { opacity: 0;   transform: scale(1.3); }
}
@media (prefers-reduced-motion: reduce) {
    .bp-fab-ring { animation: none; opacity: 0; }
}

.bp-chat-panel {
    position: fixed;
    right: 28px;
    bottom: 100px;
    z-index: 39;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 150px);
    background: rgba(14, 19, 30, 0.72);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--bp-line);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255,255,255,0.06);
    opacity: 0;
    transform: translateY(14px) scale(0.98);
    pointer-events: none;
    transition: opacity .16s ease, transform .16s ease;
}
.bp-chat-panel.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.bp-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--bp-line);
    flex-shrink: 0;
}
.bp-chat-head-title { display: flex; align-items: center; gap: 9px; }
.bp-chat-head-title strong { font-family: var(--bp-font-display); font-size: 13.5px; display: block; }
.bp-chat-head-sub { font-family: var(--bp-font-mono); font-size: 10px; color: var(--bp-faint); }
.bp-chat-close {
    background: var(--bp-panel-2); border: 1px solid var(--bp-line); color: var(--bp-muted); cursor: pointer;
    font-size: 14px; width: 28px; height: 28px; border-radius: 50%;
}
.bp-chat-close:hover { color: var(--bp-text); background: rgba(255,255,255,0.1); }

.bp-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bp-chat-composer {
    border-top: 1px solid var(--bp-line);
    padding: 10px 12px;
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.bp-chat-composer textarea {
    flex: 1;
    resize: none;
    max-height: 120px;
    min-height: 40px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--bp-line);
    border-radius: 14px;
    padding: 10px 14px;
    color: var(--bp-text);
    font-family: var(--bp-font-body);
    font-size: 13px;
    line-height: 1.4;
}
.bp-chat-composer textarea:focus { outline: 2px solid var(--bp-signal); outline-offset: 1px; }

.bp-chat-send {
    width: 38px; height: 38px; border-radius: 50%; border: none; flex-shrink: 0;
    background: var(--bp-signal); color: #1B0F33; cursor: pointer; font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 16px rgba(168,85,247,0.35);
}
.bp-chat-send:hover { opacity: .9; }
.bp-chat-send:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }

.bp-chat-typing { display: flex; gap: 4px; padding: 6px 0; }
.bp-chat-typing span {
    width: 6px; height: 6px; border-radius: 50%; background: var(--bp-faint);
    animation: bp-typing-dot 1.2s infinite;
}
.bp-chat-typing span:nth-child(2) { animation-delay: .15s; }
.bp-chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bp-typing-dot {
    0%, 60%, 100% { transform: translateY(0); opacity: .4; }
    30% { transform: translateY(-3px); opacity: 1; }
}

/* Full-page chat variant (Brain > Assistant) */
.bp-chat-full {
    display: flex;
    flex-direction: column;
    height: 62vh;
    min-height: 420px;
    background: var(--bp-panel);
    backdrop-filter: blur(var(--bp-blur));
    -webkit-backdrop-filter: blur(var(--bp-blur));
    border: 1px solid var(--bp-line);
    border-radius: var(--bp-radius);
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 14px 40px rgba(0,0,0,0.3);
}
.bp-chat-full .bp-chat-body { padding: 22px; }
.bp-chat-full .bp-chat-composer { padding: 14px 18px; }

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */

@media (max-width: 1100px) {
    .bp-kpi-row { grid-template-columns: repeat(3, 1fr); }
    .bp-grid-3 { grid-template-columns: 1fr 1fr; }
    .bp-dept-grid { grid-template-columns: repeat(2, 1fr); }
    .bp-kanban { grid-template-columns: 1fr; }
    .bp-form-grid { grid-template-columns: 1fr; }
    .bp-tile-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
    .bp-shell { grid-template-columns: 1fr; }
    .bp-side {
        position: fixed; left: 0; z-index: 20; margin-left: calc(-1 * var(--bp-side-w));
    }
    .bp-shell.bp-nav-open .bp-side { margin-left: 0; box-shadow: 0 0 0 999px rgba(0,0,0,0.5); }
    .bp-burger { display: block; }
    .bp-grid-2, .bp-grid-3 { grid-template-columns: 1fr; }
    .bp-kpi-row { grid-template-columns: repeat(2, 1fr); }
    .bp-pulse-strip { display: none; }
}

@media (max-width: 640px) {
    .bp-tile-grid { grid-template-columns: 1fr; }
    .bp-chat-panel { right: 14px; left: 14px; width: auto; bottom: 88px; }
    .bp-fab { right: 18px; bottom: 18px; }
    .bp-chat-full { height: 54vh; }
    body { padding: 0; }
    .bp-shell { border-radius: 0; min-height: 100vh; box-shadow: none; }
}
