/* ==========================================================================
   SAFE VendorHub – design system
   ========================================================================== */
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('../lib/fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('../lib/fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('../lib/fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('../lib/fonts/inter-700.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 800; font-display: swap; src: url('../lib/fonts/inter-800.woff2') format('woff2'); }

:root {
  --brand: #5b5bf6;
  --brand-2: #8b5cf6;
  --brand-3: #06b6d4;
  --brand-grad: linear-gradient(135deg, #5b5bf6 0%, #8b5cf6 55%, #c026d3 100%);
  --brand-soft: rgba(91, 91, 246, .1);
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #e7e9f2;
  --text: #0f172a;
  --muted: #64748b;
  --sidebar-bg: #0b1020;
  --sidebar-text: #a5adc6;
  --sidebar-active: #ffffff;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow: 0 4px 24px -6px rgba(16, 24, 40, .10);
  --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, .18);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar-w: 264px;
  --topbar-h: 64px;
  --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-primary: #5b5bf6;
  --bs-primary-rgb: 91, 91, 246;
  --bs-link-color: #5b5bf6;
  --bs-link-color-rgb: 91, 91, 246;
  --bs-link-hover-color: #4338ca;
  --bs-border-radius: 10px;
}
[data-bs-theme=dark] {
  --bg: #0b0f1a;
  --surface: #121828;
  --surface-2: #161d30;
  --border: #232b42;
  --text: #e5e9f5;
  --muted: #8b94b0;
  --sidebar-bg: #070a13;
  --brand-soft: rgba(139, 139, 255, .14);
  --shadow: 0 4px 24px -6px rgba(0, 0, 0, .5);
  --bs-body-bg: #0b0f1a;
  --bs-body-color: #e5e9f5;
  --bs-border-color: #232b42;
  --bs-secondary-bg: #161d30;
  --bs-tertiary-bg: #121828;
}

html, body { height: 100%; }
body { font-family: var(--bs-body-font-family); background: var(--bg); color: var(--text); font-size: .9rem; -webkit-font-smoothing: antialiased; letter-spacing: -.005em; }
a { text-decoration: none; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.text-muted, .text-secondary { color: var(--muted) !important; }
.fw-800 { font-weight: 800; }
.small-caps { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); }
::selection { background: rgba(91, 91, 246, .25); }
.scroll-thin::-webkit-scrollbar, body::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll-thin::-webkit-scrollbar-thumb, body::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, .35); border-radius: 8px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn { font-weight: 600; border-radius: 10px; padding: .5rem .95rem; font-size: .86rem; display: inline-flex; align-items: center; gap: .4rem; justify-content: center; }
.btn-sm { padding: .32rem .7rem; font-size: .8rem; border-radius: 8px; }
.btn-lg { padding: .75rem 1.4rem; font-size: 1rem; border-radius: 12px; }
.btn-primary { background: var(--brand-grad); border: 0; box-shadow: 0 6px 16px -6px rgba(91, 91, 246, .6); }
.btn-primary:hover, .btn-primary:focus { background: linear-gradient(135deg, #4f4fe8 0%, #7c4ded 55%, #a21caf 100%); box-shadow: 0 8px 20px -6px rgba(91, 91, 246, .7); }
.btn-light { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.btn-light:hover { background: var(--surface-2); border-color: #d5d9e8; }
.btn-soft { background: var(--brand-soft); color: var(--brand); border: 0; }
.btn-soft:hover { background: rgba(91, 91, 246, .18); color: #4338ca; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 10px; }
.btn-outline-primary { color: var(--brand); border-color: rgba(91, 91, 246, .45); }
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); }

/* ── Forms ───────────────────────────────────────────────── */
.form-control, .form-select { border-radius: 10px; border-color: var(--border); padding: .55rem .8rem; font-size: .88rem; background-color: var(--surface); color: var(--text); }
.form-control:focus, .form-select:focus { border-color: #a5a5fb; box-shadow: 0 0 0 4px rgba(91, 91, 246, .12); }
.form-label { font-weight: 600; font-size: .8rem; color: var(--text); margin-bottom: .35rem; }
.form-text { color: var(--muted); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon > .form-control { padding-left: 2.3rem; }

/* ── App shell ───────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--sidebar-bg); color: var(--sidebar-text); position: fixed; inset: 0 auto 0 0; z-index: 1040; display: flex; flex-direction: column; transition: transform .25s ease, width .25s ease;
  background-image: radial-gradient(600px 300px at -10% -10%, rgba(91, 91, 246, .28), transparent 60%), radial-gradient(400px 300px at 120% 110%, rgba(192, 38, 211, .18), transparent 60%); }
.sidebar .brand { height: var(--topbar-h); display: flex; align-items: center; gap: .7rem; padding: 0 1.25rem; color: #fff; font-weight: 800; font-size: 1.08rem; letter-spacing: -.02em; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-grad); display: grid; place-items: center; color: #fff; font-size: 1.05rem; box-shadow: 0 8px 18px -6px rgba(139, 92, 246, .8); flex-shrink: 0; }
.brand small { display: block; font-size: .64rem; font-weight: 600; color: #8b93b5; letter-spacing: .06em; text-transform: uppercase; }
.sidebar nav { flex: 1; overflow-y: auto; padding: .75rem .75rem 1.5rem; }
.sidebar nav::-webkit-scrollbar { width: 4px; } .sidebar nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); }
.nav-section { font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: #5d6584; padding: 1rem .75rem .4rem; }
.nav-link-x { display: flex; align-items: center; gap: .75rem; padding: .55rem .75rem; border-radius: 10px; color: var(--sidebar-text); font-weight: 500; font-size: .87rem; transition: all .15s ease; position: relative; }
.nav-link-x i { font-size: 1.05rem; width: 20px; text-align: center; opacity: .9; }
.nav-link-x:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav-link-x.active { color: #fff; background: linear-gradient(90deg, rgba(91, 91, 246, .35), rgba(139, 92, 246, .12)); box-shadow: inset 0 0 0 1px rgba(139, 139, 255, .25); }
.nav-link-x.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand-grad); }
.nav-link-x .count { margin-left: auto; font-size: .68rem; background: rgba(255, 255, 255, .1); color: #fff; border-radius: 20px; padding: .05rem .5rem; font-weight: 700; }
.nav-link-x .count.hot { background: #ef4444; }
.sidebar-footer { padding: .9rem; border-top: 1px solid rgba(255, 255, 255, .06); }
.sidebar-card { background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07); border-radius: 12px; padding: .8rem; font-size: .78rem; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; transition: margin .25s ease; }
.topbar { height: var(--topbar-h); position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: .75rem; padding: 0 1.5rem; background: rgba(244, 246, 251, .78); backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--border); }
[data-bs-theme=dark] .topbar { background: rgba(11, 15, 26, .78); }
.topbar .search { max-width: 460px; flex: 1; }
.topbar .search .form-control { background: var(--surface); border-radius: 12px; padding-left: 2.4rem; }
.topbar .search kbd { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); font-size: .68rem; padding: .1rem .35rem; border-radius: 6px; }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); max-height: 420px; overflow: auto; display: none; z-index: 1050; }
.search-results.show { display: block; }
.search-results a { display: flex; gap: .7rem; padding: .6rem .9rem; color: var(--text); align-items: center; }
.search-results a:hover, .search-results a.active { background: var(--brand-soft); }
.search-results .grp { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: .6rem .9rem .2rem; }
.content { padding: 1.5rem; flex: 1; }
.content-narrow { max-width: 1280px; margin: 0 auto; }
.avatar { width: 36px; height: 36px; border-radius: 11px; display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: .8rem; flex-shrink: 0; }
.avatar-sm { width: 28px; height: 28px; border-radius: 8px; font-size: .68rem; }
.avatar-lg { width: 56px; height: 56px; border-radius: 16px; font-size: 1.2rem; }
.avatar-xl { width: 72px; height: 72px; border-radius: 20px; font-size: 1.5rem; }
.bell { position: relative; }
.bell .dot { position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; border-radius: 20px; background: #ef4444; color: #fff; font-size: .62rem; font-weight: 700; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--bg); }
.dropdown-menu { border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: .4rem; background: var(--surface); }
.dropdown-item { border-radius: 8px; padding: .45rem .7rem; font-size: .86rem; display: flex; align-items: center; gap: .55rem; color: var(--text); }
.dropdown-item:hover { background: var(--brand-soft); color: var(--text); }
.notif-menu { width: 380px; max-height: 480px; overflow: auto; }
.notif { display: flex; gap: .7rem; padding: .65rem; border-radius: 10px; color: var(--text); }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: var(--brand-soft); }
.notif .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  body.sidebar-open .sidebar { transform: none; }
  .main { margin-left: 0; }
  .content { padding: 1rem; }
}
body.sidebar-collapsed .sidebar { width: 78px; }
body.sidebar-collapsed .sidebar .brand span, body.sidebar-collapsed .nav-section, body.sidebar-collapsed .nav-link-x span, body.sidebar-collapsed .nav-link-x .count, body.sidebar-collapsed .sidebar-footer { display: none; }
body.sidebar-collapsed .nav-link-x { justify-content: center; }
body.sidebar-collapsed .main { margin-left: 78px; }

/* ── Page header ─────────────────────────────────────────── */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-header h1 { font-size: 1.55rem; margin: 0; font-weight: 800; }
.page-header .sub { color: var(--muted); margin-top: .2rem; }
.breadcrumb { font-size: .78rem; margin-bottom: .35rem; }
.breadcrumb a { color: var(--muted); }

/* ── Cards ───────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-header { background: transparent; border-bottom: 1px solid var(--border); padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.card-header h5, .card-header h6 { margin: 0; font-weight: 700; font-size: .98rem; }
.card-body { padding: 1.25rem; }
.card-hover { transition: transform .18s ease, box-shadow .18s ease, border-color .18s; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #d4d6f7; }
.card-glass { background: linear-gradient(135deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .7)); backdrop-filter: blur(10px); }

.kpi { padding: 1.1rem 1.2rem; display: flex; gap: 1rem; align-items: center; height: 100%; position: relative; overflow: hidden; }
.kpi .ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; flex-shrink: 0; }
.kpi .val { font-size: 1.65rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.kpi .lbl { color: var(--muted); font-size: .8rem; font-weight: 500; }
.kpi .trend { font-size: .74rem; font-weight: 600; }
.tone-indigo { background: rgba(91, 91, 246, .12); color: #5b5bf6; }
.tone-blue { background: rgba(14, 165, 233, .12); color: #0284c7; }
.tone-green { background: rgba(16, 185, 129, .13); color: #059669; }
.tone-red { background: rgba(239, 68, 68, .12); color: #dc2626; }
.tone-orange { background: rgba(249, 115, 22, .13); color: #ea580c; }
.tone-purple { background: rgba(168, 85, 247, .13); color: #9333ea; }
.tone-teal { background: rgba(20, 184, 166, .13); color: #0d9488; }
.tone-pink { background: rgba(236, 72, 153, .12); color: #db2777; }
.tone-gray { background: rgba(100, 116, 139, .12); color: #475569; }
.tone-amber { background: rgba(245, 158, 11, .14); color: #d97706; }

/* ── Badges ──────────────────────────────────────────────── */
.badge-soft { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 600; padding: .25rem .6rem; border-radius: 20px; white-space: nowrap; }
.badge-soft::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-soft-success { background: rgba(16, 185, 129, .12); color: #047857; }
.badge-soft-danger { background: rgba(239, 68, 68, .12); color: #b91c1c; }
.badge-soft-warning { background: rgba(245, 158, 11, .15); color: #b45309; }
.badge-soft-info { background: rgba(91, 91, 246, .12); color: #4338ca; }
.badge-soft-secondary { background: rgba(100, 116, 139, .13); color: #475569; }
[data-bs-theme=dark] .badge-soft-success { color: #34d399; } [data-bs-theme=dark] .badge-soft-danger { color: #f87171; }
[data-bs-theme=dark] .badge-soft-warning { color: #fbbf24; } [data-bs-theme=dark] .badge-soft-info { color: #a5b4fc; } [data-bs-theme=dark] .badge-soft-secondary { color: #a5adc6; }
.risk-pill { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; font-size: .74rem; padding: .22rem .6rem; border-radius: 8px; }
.risk-pill i { font-size: .45rem; }
.risk-high { background: rgba(239, 68, 68, .12); color: #dc2626; }
.risk-medium { background: rgba(245, 158, 11, .15); color: #c2710c; }
.risk-low { background: rgba(16, 185, 129, .13); color: #059669; }
.risk-none { background: rgba(100, 116, 139, .12); color: #64748b; }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .55rem; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); font-size: .74rem; font-weight: 600; color: var(--muted); }

/* ── Tables ──────────────────────────────────────────────── */
.table { --bs-table-bg: transparent; color: var(--text); margin: 0; }
.table > :not(caption) > * > * { padding: .75rem 1rem; border-bottom-color: var(--border); }
.table thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table thead th.sortable { cursor: pointer; user-select: none; }
.table thead th.sortable:hover { color: var(--brand); }
.table thead th .sort-ic { opacity: .35; font-size: .7rem; margin-left: .2rem; }
.table thead th.sorted .sort-ic { opacity: 1; color: var(--brand); }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--brand-soft); }
.table td { vertical-align: middle; }
.table-card { border-radius: var(--radius); overflow: hidden; }
.table-responsive { border-radius: 0 0 var(--radius) var(--radius); }
.tbl-toolbar { display: flex; gap: .6rem; align-items: center; padding: .85rem 1rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tbl-footer { display: flex; align-items: center; justify-content: space-between; padding: .7rem 1rem; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--border); }
.pagination .page-link { border-radius: 8px !important; margin: 0 2px; border: 1px solid var(--border); color: var(--text); font-size: .8rem; padding: .25rem .6rem; background: var(--surface); }
.pagination .active .page-link { background: var(--brand); border-color: var(--brand); color: #fff; }
.entity { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.entity .t { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entity .s { font-size: .76rem; color: var(--muted); }
.vendor-logo { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: .82rem; flex-shrink: 0; }

/* ── Tabs ────────────────────────────────────────────────── */
.nav-tabs-x { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); overflow-x: auto; padding: 0 .5rem; }
.nav-tabs-x .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; padding: .85rem .9rem; white-space: nowrap; border-radius: 0; display: flex; align-items: center; gap: .45rem; font-size: .86rem; }
.nav-tabs-x .nav-link.active { color: var(--brand); border-bottom-color: var(--brand); background: transparent; }
.nav-tabs-x .nav-link .badge { font-size: .65rem; }
.nav-pills-x .nav-link { color: var(--muted); font-weight: 600; border-radius: 10px; font-size: .84rem; padding: .45rem .85rem; }
.nav-pills-x .nav-link.active { background: var(--brand-soft); color: var(--brand); }

/* ── Workflow stepper & timeline ─────────────────────────── */
.stepper { display: flex; gap: 0; overflow-x: auto; padding: .25rem 0 .5rem; }
.step { flex: 1; min-width: 108px; text-align: center; position: relative; }
.step::before { content: ''; position: absolute; top: 17px; left: -50%; right: 50%; height: 3px; background: var(--border); z-index: 0; }
.step:first-child::before { display: none; }
.step .dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto .45rem; background: var(--surface); border: 2px solid var(--border); color: var(--muted); position: relative; z-index: 1; font-size: .95rem; }
.step .lbl { font-size: .72rem; font-weight: 600; color: var(--muted); line-height: 1.25; }
.step.done .dot { background: #10b981; border-color: #10b981; color: #fff; }
.step.done::before, .step.current::before { background: #10b981; }
.step.current .dot { background: var(--brand-grad); border-color: transparent; color: #fff; box-shadow: 0 0 0 6px rgba(91, 91, 246, .18); animation: pulse 2s infinite; }
.step.current .lbl { color: var(--brand); }
.step.alert .dot { background: #ef4444; border-color: #ef4444; color: #fff; box-shadow: 0 0 0 6px rgba(239, 68, 68, .18); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 6px rgba(91, 91, 246, .18); } 50% { box-shadow: 0 0 0 10px rgba(91, 91, 246, .06); } }
.timeline { position: relative; padding-left: 1.6rem; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 1.1rem; }
.tl-item .tl-dot { position: absolute; left: -1.6rem; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 3px solid var(--brand); }
.tl-item .tl-time { font-size: .74rem; color: var(--muted); }
.tl-item .tl-title { font-weight: 600; }
.tl-item .tl-body { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: .5rem .7rem; margin-top: .35rem; font-size: .84rem; }

/* ── Kanban ──────────────────────────────────────────────── */
.kanban { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 1rem; align-items: flex-start; }
.kanban-col { min-width: 280px; width: 280px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; display: flex; flex-direction: column; max-height: calc(100vh - 220px); }
.kanban-col .head { padding: .85rem 1rem; display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: .85rem; border-bottom: 1px solid var(--border); }
.kanban-col .head .swatch { width: 10px; height: 10px; border-radius: 3px; }
.kanban-col .body { padding: .7rem; overflow-y: auto; display: flex; flex-direction: column; gap: .6rem; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .8rem; box-shadow: var(--shadow-sm); color: var(--text); display: block; transition: all .15s; }
.kcard:hover { border-color: #b9bbf8; transform: translateY(-2px); box-shadow: var(--shadow); color: var(--text); }
.progress { height: 6px; border-radius: 6px; background: var(--border); }
.progress-bar { background: var(--brand-grad); }

/* ── Misc ────────────────────────────────────────────────── */
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty i { font-size: 2.6rem; display: block; margin-bottom: .6rem; opacity: .5; }
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem 1.5rem; }
.dl-grid dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin-bottom: .15rem; }
.dl-grid dd { margin: 0; font-weight: 500; word-break: break-word; }
.hero-strip { background: var(--brand-grad); color: #fff; border-radius: var(--radius); padding: 1.6rem 1.8rem; position: relative; overflow: hidden; }
.hero-strip::after { content: ''; position: absolute; right: -80px; top: -80px; width: 300px; height: 300px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.hero-strip::before { content: ''; position: absolute; right: 120px; bottom: -120px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.hero-strip h2, .hero-strip h3 { color: #fff; }
.guard-list li { display: flex; gap: .5rem; align-items: flex-start; padding: .3rem 0; font-size: .83rem; }
.action-bar { display: flex; flex-wrap: wrap; gap: .5rem; }
.toast-container { z-index: 2000; }
.toast { border: 0; border-radius: 14px; box-shadow: var(--shadow-lg); background: var(--surface); color: var(--text); }
.modal-content { border: 0; border-radius: 20px; box-shadow: var(--shadow-lg); background: var(--surface); }
.modal-header { border-bottom: 1px solid var(--border); padding: 1.1rem 1.4rem; }
.modal-body { padding: 1.4rem; }
.modal-footer { border-top: 1px solid var(--border); padding: .9rem 1.4rem; }
.list-tile { display: flex; align-items: center; gap: .8rem; padding: .75rem 0; border-bottom: 1px dashed var(--border); }
.list-tile:last-child { border-bottom: 0; }
.doc-tile { border: 1px solid var(--border); border-radius: 12px; padding: .8rem; display: flex; gap: .75rem; align-items: center; background: var(--surface); }
.doc-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; }
.score-ring { --v: 50; --c: #5b5bf6; width: 120px; height: 120px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--v) * 1%), var(--border) 0); display: grid; place-items: center; }
.score-ring > div { width: 92px; height: 92px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; }
.score-ring .n { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.factor-bar { height: 8px; border-radius: 8px; background: var(--border); overflow: hidden; }
.factor-bar > span { display: block; height: 100%; border-radius: 8px; }
.sticky-side { position: sticky; top: calc(var(--topbar-h) + 1rem); }
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.filter-bar .form-select, .filter-bar .form-control { width: auto; min-width: 150px; }
.mermaid { background: var(--surface); text-align: center; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: .78rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: .75rem; white-space: pre-wrap; word-break: break-all; max-height: 300px; overflow: auto; }
.stat-mini { display: flex; flex-direction: column; padding: .8rem 1rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.stat-mini b { font-size: 1.25rem; font-weight: 800; }
.stat-mini span { font-size: .74rem; color: var(--muted); }
.cursor-pointer { cursor: pointer; }
.qtype { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.perm-grid td, .perm-grid th { text-align: center; }
.perm-grid td:first-child, .perm-grid th:first-child { text-align: left; }

/* ── Dashboard builder ───────────────────────────────────── */
.grid-stack { margin: -8px; }
.grid-stack-item-content { inset: 8px !important; }
.widget { height: 100%; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.widget .w-head { display: flex; align-items: center; gap: .5rem; padding: .75rem 1rem .25rem; }
.widget .w-head h6 { margin: 0; font-size: .86rem; font-weight: 700; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.widget .w-tools { display: none; gap: .25rem; }
.editing .widget .w-tools { display: flex; }
.editing .widget { border-style: dashed; border-color: #a5a5fb; cursor: move; }
.widget .w-body { flex: 1; min-height: 0; padding: .5rem 1rem 1rem; position: relative; }
.widget .w-body canvas { position: absolute; inset: .5rem 1rem 1rem; max-width: calc(100% - 2rem); }
.widget.kpi-w .w-body { display: flex; align-items: center; gap: 1rem; padding-top: 0; }
.widget.kpi-w .kv { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.widget.kpi-w .ic { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; font-size: 1.45rem; }
.widget .w-table { overflow: auto; height: 100%; font-size: .8rem; }
.widget .w-table .table > :not(caption) > * > * { padding: .45rem .6rem; }

/* ── Public / landing ────────────────────────────────────── */
.public { background: #070b18; color: #e6e9f5; min-height: 100vh; overflow-x: hidden; }
.public .navbar-x { position: sticky; top: 0; z-index: 100; backdrop-filter: blur(14px); background: rgba(7, 11, 24, .7); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.public a { color: inherit; }
.mesh { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.mesh span { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; animation: float 18s ease-in-out infinite; }
.mesh .m1 { width: 520px; height: 520px; background: #5b5bf6; top: -160px; left: -120px; }
.mesh .m2 { width: 460px; height: 460px; background: #c026d3; top: 40px; right: -140px; animation-delay: -6s; }
.mesh .m3 { width: 380px; height: 380px; background: #06b6d4; bottom: -180px; left: 35%; animation-delay: -12s; opacity: .35; }
@keyframes float { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(40px, -30px) scale(1.08); } 66% { transform: translate(-30px, 20px) scale(.95); } }
.hero { position: relative; padding: 6rem 0 5rem; }
.hero h1 { font-size: clamp(2.3rem, 5vw, 4rem); font-weight: 800; letter-spacing: -.045em; line-height: 1.05; color: #fff; }
.grad-text { background: linear-gradient(90deg, #a5b4fc, #e879f9, #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { color: #aab2cf; font-size: 1.15rem; max-width: 640px; }
.pill { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .8rem; border-radius: 30px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); color: #c7cdf0; font-size: .8rem; font-weight: 600; }
.glass { background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); border-radius: 20px; backdrop-filter: blur(12px); }
.module-card { padding: 1.4rem; height: 100%; display: flex; flex-direction: column; gap: .6rem; transition: all .2s ease; color: #e6e9f5; }
.module-card:hover { transform: translateY(-4px); border-color: rgba(165, 180, 252, .45); background: rgba(255, 255, 255, .07); color: #fff; }
.module-card .ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 1.3rem; color: #fff; }
.module-card h5 { color: #fff; margin: 0; font-size: 1.02rem; }
.module-card p { color: #9aa3c2; margin: 0; font-size: .85rem; flex: 1; }
.module-card .go { font-size: .8rem; font-weight: 600; color: #a5b4fc; }
.persona { padding: 1rem; display: flex; gap: .8rem; align-items: center; transition: all .2s; cursor: pointer; color: #e6e9f5; width: 100%; text-align: left; }
.persona:hover { border-color: rgba(165, 180, 252, .5); background: rgba(255, 255, 255, .08); }
.persona .r { font-size: .75rem; color: #9aa3c2; }
.section-title { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 800; letter-spacing: -.03em; color: #fff; }
.public .text-muted { color: #8f98b8 !important; }
.flow { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: center; }
.flow .node { padding: .55rem .9rem; border-radius: 12px; font-size: .8rem; font-weight: 600; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); color: #e6e9f5; }
.flow .arrow { color: #6b74a0; }
.stat-big b { font-size: 2.2rem; font-weight: 800; color: #fff; display: block; letter-spacing: -.03em; }
.stat-big span { color: #8f98b8; font-size: .85rem; }
.mock { border-radius: 18px; overflow: hidden; box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .08); background: #0f1424; }
.mock .bar { height: 34px; background: #151b2e; display: flex; align-items: center; gap: 6px; padding: 0 12px; }
.mock .bar i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side { position: relative; overflow: hidden; background: #070b18; color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--bg); }
.auth-card { width: 100%; max-width: 440px; }
@media (max-width: 991.98px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; } }
.demo-user { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); width: 100%; text-align: left; transition: all .15s; color: var(--text); }
.demo-user:hover { border-color: #a5a5fb; background: var(--brand-soft); }
.fade-in { animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.print-only { display: none; }
@media print {
  .sidebar, .topbar, .no-print, .btn { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; }
  .print-only { display: block; }
  .card { box-shadow: none; border: 0; }
  body { background: #fff; }
}

/* ── Environment marker ─────────────────────────────────── */
.env-pill { align-items: center; gap: .4rem; font-size: .68rem; font-weight: 800; letter-spacing: .12em; padding: .3rem .65rem; border-radius: 8px; background: rgba(245, 158, 11, .14); color: #b45309; border: 1px solid rgba(245, 158, 11, .35); cursor: help; }
.env-pill i { font-size: .45rem; animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 50% { opacity: .3; } }
[data-bs-theme=dark] .env-pill { color: #fbbf24; }
.env-strip { background: linear-gradient(90deg, #f59e0b, #f97316); color: #1f1300; font-size: .72rem; font-weight: 700; text-align: center; padding: .3rem 1rem; letter-spacing: .02em; }
.demo-panel { border: 1px dashed var(--border); border-radius: 14px; padding: .9rem; background: var(--surface); }