/* ══════════════════════════════════════════════════════════════════════════════
   SENTINEL — Fraud Management workspace (DaasLabs Telecom)
   Consulting-light design system shared with the DaasLabs sites:
   Source Serif 4 (headings, figures) + Inter (UI), white surfaces, deep navy ink,
   one electric-blue accent, hairline borders, square corners, no gradients or glow.
   ══════════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600;8..60,700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* ── DaasLabs tokens (same values as static/css/style.css) ── */
    --ink: #051C2C;
    --ink-2: #2B3A48;
    --ink-3: #5B6772;
    --ink-4: #8A949D;
    --accent: #2251FF;
    --accent-hover: #1238D6;
    --accent-soft: #EEF2FF;
    --accent-line: #C9D4FF;
    --cyan: #00A9F4;
    --surface: #FFFFFF;
    --surface-2: #F6F7F9;
    --surface-3: #EDEFF2;
    --line: #E1E4E8;
    --line-2: #CDD2D8;
    --positive: #13795B;
    --positive-soft: #E7F4EF;
    --warning: #A86400;
    --warning-soft: #FBF1E1;
    --negative: #C8262D;
    --negative-soft: #FCEBEC;
    --high: #B5461F;           /* muted rust between warning and negative */
    --high-soft: #F8ECE6;
    --chart-5: #0E7C86;
    --chart-7: #1438B8;
    --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    --font-sans: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;

    /* ── Legacy SENTINEL tokens, mapped onto the palette (templates use these) ── */
    --color-navy: var(--ink);
    --color-navy-deep: var(--ink);
    --color-navy-light: #13293A;
    --color-teal: var(--chart-5);
    --color-electric-blue: var(--accent);
    --color-purple: var(--chart-7);
    --color-rag-red: var(--negative);
    --color-rag-amber: var(--warning);
    --color-rag-green: var(--positive);
    --color-success: var(--positive);
    --color-warning: var(--warning);
    --color-danger: var(--negative);
    --color-slate-50: var(--surface-2);
    --color-slate-100: var(--surface-3);
    --color-slate-200: var(--line);
    --color-slate-300: var(--line-2);
    --color-slate-400: var(--ink-4);
    --color-slate-500: var(--ink-3);
    --color-slate-600: var(--ink-3);
    --color-slate-700: var(--ink-2);
    --color-slate-800: var(--ink);
    --color-slate-900: var(--ink);

    /* Layout */
    --sidebar-width: 256px;
    --topbar-height: 60px;
    --content-bg: var(--surface-2);

    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: 0 8px 24px rgba(5, 28, 44, 0.06);
    --shadow-card: none;
    --shadow-card-hover: 0 8px 24px rgba(5, 28, 44, 0.06);

    --radius-sm: 2px;
    --radius-md: 2px;
    --radius-lg: 2px;
    --radius-xl: 2px;

    --transition-fast: 150ms ease;
    --transition: 200ms ease;
}

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.55;
    color: var(--ink-2);
    background: var(--content-bg);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 500;
    color: var(--ink);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
strong, b { font-weight: 600; color: var(--ink); }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code { color: var(--ink-2); background: var(--surface-2); padding: 0.1rem 0.35rem; border-radius: 2px; font-size: 0.8125em; }

/* ══════════════════════════════════════════════════════════════════════════════
   SIDEBAR (light, hairline)
   ══════════════════════════════════════════════════════════════════════════════ */

.sentinel-sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    overflow-y: auto;
    transition: transform 0.25s ease;
}

.sentinel-sidebar::-webkit-scrollbar { width: 6px; }
.sentinel-sidebar::-webkit-scrollbar-track { background: transparent; }
.sentinel-sidebar::-webkit-scrollbar-thumb { background: var(--line-2); }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 1.125rem 1.25rem;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-serif);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
}
.sidebar-brand:hover { color: var(--ink); }
.sidebar-brand .brand-icon {
    width: 28px; height: 28px;
    background: var(--ink); color: #fff;
    border-radius: 2px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.875rem;
}

.sidebar-header { padding: 1.125rem 1.25rem 0.875rem; border-bottom: none; }
.sidebar-logo { display: flex; align-items: center; gap: 0.75rem; }
.logo-icon {
    width: 34px; height: 34px;
    background: none;
    border: 1px solid var(--line-2);
    border-top: 2px solid var(--accent);
    border-radius: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--accent);
    font-size: 1rem;
}
.logo-text { display: flex; flex-direction: column; }
.logo-name { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 600; color: var(--ink); letter-spacing: 0.02em; line-height: 1.1; }
.logo-tagline { font-size: 0.6875rem; color: var(--ink-3); letter-spacing: 0.02em; }

.sidebar-flow { padding: 0 1.25rem 0.875rem; border-bottom: 1px solid var(--line); }
.flow-steps { display: flex; align-items: center; gap: 0.375rem; }
.flow-step { font-size: 0.625rem; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.12em; }
.flow-steps i { font-size: 0.5rem; color: var(--ink-4); }

.sidebar-nav { flex: 1; padding: 0.5rem 0.75rem 0.75rem; }
.nav-section { margin-bottom: 0.25rem; }
.nav-section-title {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--ink-4);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0.875rem 0.625rem 0.375rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.4375rem 0.625rem;
    color: var(--ink-2);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 0;
    border-left: 2px solid transparent;
    transition: background var(--transition), color var(--transition);
    position: relative;
}
.nav-item:hover { background: var(--surface-2); color: var(--accent); }
.nav-item.active { background: var(--accent-soft); color: var(--ink); border-left-color: var(--accent); font-weight: 600; }
.nav-item i { font-size: 0.9375rem; color: var(--ink-3); }
.nav-item.active i, .nav-item:hover i { color: var(--accent); }
.nav-item span:first-of-type { flex: 1; }
.nav-indicator { display: none; }

.sidebar-footer { padding: 0.875rem 1.25rem; border-top: 1px solid var(--line); }
.sidebar-footer .footer-links { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.625rem; font-size: 0.75rem; }
.sidebar-footer .footer-links a { color: var(--ink-2); font-weight: 500; }
.sidebar-footer .footer-links a:hover { color: var(--accent); }
.footer-status { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.125rem; }
.status-dot { width: 7px; height: 7px; background: var(--positive); border-radius: 50%; }
.status-dot.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.status-text { font-size: 0.6875rem; color: var(--ink-3); font-weight: 500; }
.footer-version { font-size: 0.625rem; color: var(--ink-4); }

.sidebar-backdrop { display: none; }

/* ══════════════════════════════════════════════════════════════════════════════
   MAIN CONTENT AREA
   ══════════════════════════════════════════════════════════════════════════════ */

.sentinel-main { margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }

.sentinel-topbar {
    height: var(--topbar-height);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar-left { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.sidebar-toggle {
    display: none;
    width: 36px; height: 36px;
    border: 1px solid var(--line-2);
    background: var(--surface);
    border-radius: 2px;
    color: var(--ink);
    align-items: center; justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
}
.back-link { display: flex; align-items: center; gap: 0.375rem; color: var(--ink-3); text-decoration: none; font-size: 0.8125rem; font-weight: 500; white-space: nowrap; transition: color var(--transition); }
.back-link:hover { color: var(--accent); }
.topbar-crumbs { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: var(--ink-4); white-space: nowrap; }
.topbar-crumbs a { color: var(--accent); font-weight: 500; }

.topbar-center { flex: 1; text-align: left; min-width: 0; }
.topbar-title {
    font-family: var(--font-serif);
    font-size: 1.1875rem;
    font-weight: 500;
    color: var(--ink);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-right { display: flex; align-items: center; gap: 0.5rem; }
.topbar-btn {
    width: 34px; height: 34px;
    border: 1px solid var(--line-2);
    background: var(--surface);
    border-radius: 2px;
    color: var(--ink-2);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
}
.topbar-btn:hover { border-color: var(--ink); color: var(--ink); }
.topbar-divider { width: 1px; height: 24px; background: var(--line); margin: 0 0.5rem; }
.topbar-user { display: flex; flex-direction: column; text-align: right; }
.user-name { font-size: 0.8125rem; font-weight: 600; color: var(--ink); }
.user-role { font-size: 0.6875rem; color: var(--ink-3); }

.sentinel-content { flex: 1; padding: 1.75rem 1.75rem 3rem; min-width: 0; }

/* Page banner (was a coloured gradient card) */
.stage-banner {
    background: var(--surface) !important;
    border: 1px solid var(--line) !important;
    border-top: 3px solid var(--accent) !important;
}
.stage-banner.stage-act, .stage-banner.stage-realtime { border-top-color: var(--negative) !important; }
.stage-banner.stage-orient, .stage-banner.stage-decide { border-top-color: var(--warning) !important; }
.stage-banner h2 { font-family: var(--font-serif); font-size: 1.75rem !important; font-weight: 500; color: var(--ink) !important; letter-spacing: -0.015em; }
.stage-banner p { color: var(--ink-3) !important; }
.stage-banner [style*="color: white"], .stage-banner [style*="color:white"] { color: var(--ink) !important; }
.stage-banner div[style*="background: rgba(255,255,255"], .stage-banner span[style*="background: rgba(255,255,255"] { background: var(--surface-2) !important; border: 1px solid var(--line); }
.stage-banner i[style*="color: white"] { color: var(--accent) !important; }
.stage-banner > .card-body > .d-flex > .d-flex > div:first-child[style*="width"] { border-radius: 0 !important; border-top: 2px solid var(--accent); }
.stage-banner .btn[style] { background: var(--surface) !important; color: var(--ink) !important; border: 1px solid var(--ink) !important; }
.stage-banner .btn[style]:hover { background: var(--ink) !important; color: #fff !important; }
.stage-banner .status-badge[style] { background: var(--surface-2) !important; color: var(--ink) !important; border: 1px solid var(--line-2); }
.stage-banner .status-badge.is-alert { background: var(--negative-soft) !important; color: var(--negative) !important; border-color: transparent; }

/* ══════════════════════════════════════════════════════════════════════════════
   KPI CARDS
   ══════════════════════════════════════════════════════════════════════════════ */

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }

.kpi-card {
    background: var(--surface);
    border-radius: 0;
    padding: 1.125rem 1.25rem;
    border: 1px solid var(--line);
    border-top: 2px solid var(--ink);
    position: relative;
    overflow: hidden;
    transition: border-color var(--transition);
    min-width: 0;
}
.kpi-card:hover { border-top-color: var(--accent); }
.kpi-card::before { content: none; }
.kpi-card.red { border-top-color: var(--negative); }
.kpi-card.amber { border-top-color: var(--warning); }

.kpi-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.kpi-icon {
    width: auto; height: auto;
    border-radius: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.0625rem;
    background: none !important;
    color: var(--accent);
}
.kpi-icon.red { color: var(--negative); }
.kpi-icon.amber { color: var(--warning); }
.kpi-icon.green { color: var(--positive); }
.kpi-icon.blue { color: var(--accent); }
.kpi-icon.purple { color: var(--chart-7); }

.kpi-trend { font-size: 0.75rem; font-weight: 600; display: flex; align-items: center; gap: 0.25rem; }
.kpi-trend.up { color: var(--positive); }
.kpi-trend.down { color: var(--negative); }

.kpi-value {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.05;
    margin-bottom: 0.375rem;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.kpi-label { font-size: 0.6875rem; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }
.kpi-subtitle { font-size: 0.6875rem; color: var(--ink-4); margin-top: 0.25rem; }

/* ══════════════════════════════════════════════════════════════════════════════
   CARDS & PANELS
   ══════════════════════════════════════════════════════════════════════════════ */

.card {
    background: var(--surface);
    border-radius: 0;
    border: 1px solid var(--line);
    border-top: 2px solid var(--ink);
    overflow: hidden;
    min-width: 0;
}

.card-header {
    padding: 0.875rem 1.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.card-title {
    font-family: var(--font-serif);
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}
.card-title i { font-size: 0.9375rem; color: var(--accent); opacity: 1; }

.card-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.1875rem 0.5rem;
    border-radius: 2px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--ink-2);
}

.card-body { padding: 1.25rem; }
.card-body.compact { padding: 1rem; }

/* Inline tinted tiles inside cards (legacy rgba tints) → flat hairline tiles */
.card-body [style*="rgba("][style*="border-radius"],
.card-body [style*="rgba("].rounded { border-radius: 0 !important; }

/* ══════════════════════════════════════════════════════════════════════════════
   STATUS BADGES & TAGS
   ══════════════════════════════════════════════════════════════════════════════ */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.1875rem 0.5rem;
    border-radius: 2px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    background: var(--surface-2);
    color: var(--ink-2);
}

.status-badge.critical { background: var(--negative); color: #fff; }
.status-badge.high { background: var(--high-soft); color: var(--high); }
.status-badge.elevated { background: var(--warning-soft); color: var(--warning); }
.status-badge.moderate { background: var(--positive-soft); color: var(--positive); }
.status-badge.low { background: var(--surface-2); color: var(--ink-3); }

.status-badge.observe { background: var(--accent-soft); color: var(--accent); }
.status-badge.orient { background: var(--warning-soft); color: var(--warning); }
.status-badge.decide { background: var(--high-soft); color: var(--high); }
.status-badge.act { background: var(--negative-soft); color: var(--negative); }
.status-badge.closed { background: var(--positive-soft); color: var(--positive); }

.rag-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.rag-dot.red { background: var(--negative); }
.rag-dot.amber { background: var(--warning); }
.rag-dot.green { background: var(--positive); }

/* ══════════════════════════════════════════════════════════════════════════════
   DATA TABLES
   ══════════════════════════════════════════════════════════════════════════════ */

.data-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.data-table thead { position: sticky; top: 0; z-index: 10; }
.data-table th {
    padding: 0.625rem 1rem;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-3);
    background: var(--surface);
    border-bottom: 1px solid var(--ink);
    white-space: nowrap;
}
.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--ink); }
.data-table td { padding: 0.625rem 1rem; color: var(--ink-2); border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr.selected { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.data-table .text-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.75rem; }
.data-table .text-right { text-align: right; }
.data-table .text-center { text-align: center; }

/* Wide tables scroll inside their card, never the page */
.card-body:has(table), .table-scroll { overflow-x: auto; }

/* ══════════════════════════════════════════════════════════════════════════════
   OODA PIPELINE
   ══════════════════════════════════════════════════════════════════════════════ */

.ooda-pipeline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }

.ooda-stage {
    background: var(--surface);
    border-radius: 0;
    padding: 1rem 1rem 0.875rem;
    border: 1px solid var(--line);
    border-top: 2px solid var(--ink);
    text-align: left;
    position: relative;
    transition: border-color var(--transition);
    min-width: 0;
}
.ooda-stage:hover { transform: none; border-top-color: var(--accent); }
.ooda-stage::before { content: none; }
.ooda-stage.observe { border-top-color: var(--accent); }
.ooda-stage.orient { border-top-color: var(--warning); }
.ooda-stage.decide { border-top-color: var(--high); }
.ooda-stage.act { border-top-color: var(--negative); }
.ooda-stage.closed { border-top-color: var(--positive); }

.ooda-icon { font-size: 1.125rem; margin-bottom: 0.375rem; }
.ooda-stage.observe .ooda-icon { color: var(--accent); }
.ooda-stage.orient .ooda-icon { color: var(--warning); }
.ooda-stage.decide .ooda-icon { color: var(--high); }
.ooda-stage.act .ooda-icon { color: var(--negative); }
.ooda-stage.closed .ooda-icon { color: var(--positive); }

.ooda-label { font-size: 0.625rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-3); margin-bottom: 0.25rem; }
.ooda-value { font-family: var(--font-serif); font-size: 1.875rem; font-weight: 500; color: var(--ink); line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* ══════════════════════════════════════════════════════════════════════════════
   FRAUD VECTOR CARDS
   ══════════════════════════════════════════════════════════════════════════════ */

.vector-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }

.vector-card {
    background: var(--surface);
    border-radius: 0;
    border: 1px solid var(--line);
    border-top: 2px solid var(--ink);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
    cursor: pointer;
    min-width: 0;
}
.vector-card:hover { border-top-color: var(--accent); box-shadow: var(--shadow-lg); }

.vector-header { padding: 1rem; display: flex; align-items: center; gap: 0.75rem; border-bottom: 1px solid var(--line); }
.vector-icon {
    width: 36px; height: 36px;
    border-radius: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.0625rem;
    background: var(--surface-2) !important;
    border: 1px solid var(--line);
}
.vector-info { flex: 1; min-width: 0; }
.vector-name { font-family: var(--font-serif); font-size: 1rem; font-weight: 500; color: var(--ink); line-height: 1.25; }
.vector-cases { font-size: 0.75rem; color: var(--ink-3); }
.vector-body { padding: 1rem; }
.vector-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.vector-stat { text-align: left; border-top: 1px solid var(--line); padding-top: 0.5rem; }
.vector-stat-value { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.vector-stat-label { font-size: 0.625rem; color: var(--ink-4); text-transform: uppercase; letter-spacing: 0.08em; }

/* ══════════════════════════════════════════════════════════════════════════════
   ACTIVITY TIMELINE
   ══════════════════════════════════════════════════════════════════════════════ */

.activity-list { list-style: none; max-height: 400px; overflow-y: auto; }
.activity-item { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: none; }
.activity-icon {
    width: 26px; height: 26px;
    border-radius: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
    background: var(--surface-2);
    border: 1px solid var(--line);
}
.activity-icon.success { color: var(--positive); }
.activity-icon.warning { color: var(--warning); }
.activity-icon.danger { color: var(--negative); }
.activity-icon.info { color: var(--accent); }
.activity-content { flex: 1; min-width: 0; }
.activity-text { font-size: 0.8125rem; color: var(--ink-2); line-height: 1.45; overflow-wrap: anywhere; }
.activity-time { font-size: 0.6875rem; color: var(--ink-4); margin-top: 0.125rem; }

/* ══════════════════════════════════════════════════════════════════════════════
   AI CHAT PANEL (matches the DaasLabs "Ask AI Analyst" widget)
   ══════════════════════════════════════════════════════════════════════════════ */

.sentinel-ai-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    height: 46px;
    width: auto;
    padding: 0 1.125rem 0 1rem;
    background: var(--ink);
    border-radius: 2px;
    display: flex; align-items: center; gap: 0.5rem;
    color: #fff;
    font-size: 1.0625rem;
    cursor: pointer;
    box-shadow: 0 12px 32px rgba(5, 28, 44, 0.12);
    z-index: 1050;
    transition: background var(--transition);
}
.sentinel-ai-toggle::after { content: 'Ask Fraud AI Analyst'; font-size: 0.8125rem; font-weight: 600; }
.sentinel-ai-toggle:hover { background: var(--accent); transform: none; }
.ai-badge { display: none; }

.sentinel-ai-panel {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 400px;
    height: 520px;
    max-height: calc(100vh - 3rem);
    background: var(--surface);
    border-radius: 2px;
    border: 1px solid var(--line);
    box-shadow: 0 24px 60px rgba(5, 28, 44, 0.16);
    display: none;
    flex-direction: column;
    z-index: 1060;
    overflow: hidden;
}
.sentinel-ai-panel.open { display: flex; }

.ai-panel-header {
    padding: 0.875rem 1.125rem;
    background: var(--surface);
    color: var(--ink);
    border-top: 3px solid var(--accent);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
}
.ai-header-left { display: flex; align-items: center; gap: 0.5rem; }
.ai-header-left i { color: var(--accent); }
.ai-title { font-family: var(--font-serif); font-weight: 600; font-size: 1.0625rem; }
.ai-status-dot { width: 7px; height: 7px; background: var(--positive); border-radius: 50%; animation: pulse 2s infinite; }
.ai-header-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--ink-3);
    width: 30px; height: 30px;
    border-radius: 2px;
    cursor: pointer;
}
.ai-header-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink); }

.ai-panel-messages { flex: 1; overflow-y: auto; padding: 1rem; background: var(--surface-2); }
.ai-msg { display: flex; gap: 0.625rem; margin-bottom: 1rem; }
.ai-msg-avatar {
    width: 28px; height: 28px;
    background: var(--ink);
    border-radius: 2px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 0.8125rem;
    flex-shrink: 0;
}
.ai-msg-content {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 0.75rem 1rem;
    border-radius: 2px;
    font-size: 0.8125rem;
    color: var(--ink-2);
    line-height: 1.55;
    min-width: 0;
    overflow-wrap: anywhere;
}
.ai-msg-content p { margin-bottom: 0.5rem; }
.ai-msg-content p:last-child { margin-bottom: 0; }
.ai-msg-content ul { margin: 0.5rem 0; padding-left: 1.25rem; }
.ai-msg-content li { margin-bottom: 0.25rem; }

.ai-panel-input { padding: 0.75rem 0.875rem; border-top: 1px solid var(--line); background: var(--surface); }
.ai-panel-input form { display: flex; gap: 0.5rem; }
.ai-panel-input input {
    flex: 1; min-width: 0;
    border: 1px solid var(--line-2);
    border-radius: 2px;
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    font-family: var(--font-sans);
    color: var(--ink);
    outline: none;
}
.ai-panel-input input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ai-panel-input button {
    width: 40px; height: 38px;
    background: var(--accent);
    border: none;
    border-radius: 2px;
    color: #fff;
    cursor: pointer;
}
.ai-panel-input button:hover { background: var(--accent-hover); }

/* ══════════════════════════════════════════════════════════════════════════════
   CHARTS & GRIDS
   ══════════════════════════════════════════════════════════════════════════════ */

.chart-container { position: relative; height: 250px; min-width: 0; }
.chart-container.compact { height: 180px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; }

@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ══════════════════════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4375rem;
    padding: 0.5rem 1rem;
    border-radius: 2px;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition);
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-secondary { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink); background: var(--surface); color: var(--ink); }
.btn-danger { background: var(--surface); border-color: var(--negative); color: var(--negative); }
.btn-danger:hover { background: var(--negative); color: #fff; }
.btn-success { background: var(--surface); border-color: var(--positive); color: var(--positive); }
.btn-success:hover { background: var(--positive); color: #fff; }
.btn-sm { padding: 0.3125rem 0.75rem; font-size: 0.75rem; }

.form-control, .form-select, input[type="text"], input[type="search"], select { border-radius: 2px; }
.form-control, .form-select { border-color: var(--line-2); font-size: 0.8125rem; color: var(--ink); }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Tabs used on the command centre and investigation workbench */
.inv-tab, .fraud-tab, .tab-btn { border-radius: 0 !important; }

/* ══════════════════════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ══════════════════════════════════════════════════════════════════════════════ */

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.text-muted { color: var(--ink-4) !important; }
.text-sm { font-size: 0.8125rem; }
.text-xs { font-size: 0.75rem; }
.font-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.font-bold { font-weight: 700; }
.rounded { border-radius: 0 !important; }
.text-success { color: var(--positive) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--negative) !important; }
.text-primary, .text-info { color: var(--accent) !important; }

/* ══════════════════════════════════════════════════════════════════════════════
   ANIMATIONS / LOADING
   ══════════════════════════════════════════════════════════════════════════════ */

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.3s ease-out; }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.slide-up { animation: slideUp 0.4s ease-out; }
@media (prefers-reduced-motion: reduce) { .fade-in, .slide-up { animation: none; } }

.spinner {
    width: 28px; height: 28px;
    border: 2px solid var(--line);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-skeleton { background: var(--surface-3); animation: skeletonPulse 1.5s ease-in-out infinite; border-radius: 0; }
@keyframes skeletonPulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

/* Coming-soon module pages */
.soon-panel { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--accent); padding: 2.5rem 2.25rem; max-width: 820px; }
.soon-panel .eyebrow { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.soon-panel h2 { font-size: 2rem; margin: 0 0 0.75rem; letter-spacing: -0.02em; }
.soon-panel p { font-size: 0.9375rem; color: var(--ink-3); max-width: 620px; margin-bottom: 1.25rem; }
.soon-panel ul { list-style: none; border-top: 1px solid var(--line); margin: 0 0 1.5rem; }
.soon-panel li { display: flex; gap: 0.625rem; align-items: baseline; padding: 0.5rem 0; border-bottom: 1px solid var(--line); font-size: 0.875rem; color: var(--ink-2); }
.soon-panel li::before { content: ''; width: 5px; height: 5px; background: var(--accent); flex: 0 0 5px; transform: translateY(-2px); }
.soon-links { display: flex; gap: 0.625rem; flex-wrap: wrap; }

/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — sidebar becomes an off-canvas drawer below 992px
   ══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 991.98px) {
    .sentinel-sidebar { transform: translateX(-100%); box-shadow: none; }
    body.sidebar-open .sentinel-sidebar { transform: translateX(0); box-shadow: 0 24px 60px rgba(5, 28, 44, 0.16); }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(5, 28, 44, 0.35); z-index: 1035; }
    .sentinel-main { margin-left: 0; }
    .sidebar-toggle { display: inline-flex; }
    .topbar-divider, .topbar-user { display: none; }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
    .ooda-pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sentinel-content { padding: 1rem 1rem 5rem; }
    .sentinel-topbar { padding: 0 1rem; gap: 0.5rem; }
    .topbar-crumbs, .back-link span { display: none; }
    .topbar-title { font-size: 1.0625rem; }
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
    .kpi-value { font-size: 1.5rem; }
    .card-body { padding: 1rem; }
    .stage-banner h2 { font-size: 1.375rem !important; }
    .stage-banner .card-body > .d-flex { flex-wrap: wrap; gap: 1rem; }
    .vector-stats { gap: 0.5rem; }
    .soon-panel { padding: 1.75rem 1.25rem; }
    .soon-panel h2 { font-size: 1.625rem; }
    /* Legacy inline flex rows and fixed-width columns wrap instead of overflowing */
    .sentinel-content .d-flex { flex-wrap: wrap; }
    .sentinel-content [style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
    .sentinel-content .kpi-grid[style], .sentinel-content .ooda-pipeline[style] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .sentinel-content [style*="min-width"] { min-width: 0 !important; }
    .sentinel-content [style*="width: 3"], .sentinel-content [style*="width:3"], .sentinel-content [style*="width: 4"] { max-width: 100%; }
    .sentinel-ai-panel { right: 0.5rem; left: 0.5rem; bottom: 0.5rem; width: auto; max-height: calc(100vh - 1rem); }
    .sentinel-ai-toggle { bottom: 1rem; right: 1rem; padding: 0 0.875rem; }
    .sentinel-ai-toggle::after { content: none; }
}

@media (max-width: 420px) {
    .kpi-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .ooda-pipeline { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .topbar-btn { width: 32px; height: 32px; }
}
