﻿/* LeadFutureStyling.css — accessibility-focused pass + Notes/Feedback additions */

/* =======================================================================
   DESIGN TOKENS
   ======================================================================= */
:root {
    --brand: #f2a365;
    /* Category accents (WCAG-friendly on dark) */
    --accent-pending: #f2a365; /* amber/orange */
    --accent-open: #8aa0ff; /* indigo/blue */
    --accent-actioned: #44d19a; /* teal/green */
    --accent-archived: #9aa3b2; /* cool gray */
    /* Text tokens */
    --ink: #eaf0ff; /* default text */
    --ink-strong: #ffffff; /* headings / important */
    --ink-dim: #d0dbff; /* helper text */
    /* Surfaces */
    --panel: rgba(32,38,78,.94); /* card panels (near-opaque) */
    --panel-strong: rgba(40,46,92,.98); /* stronger panel (modal/pills) */
    /* Lines / shadows */
    --line-soft: rgba(255,255,255,.28);
    --line-faint: rgba(255,255,255,.14);
    --shadow: 0 22px 80px rgba(0,0,0,.65);
}

/* =======================================================================
   BASE
   ======================================================================= */
*, *::before, *::after {
    box-sizing: border-box
}

html {
    color-scheme: dark
}

body {
    margin: 0;
    color: var(--ink);
    background: #000;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
    line-height: 1.45;
}

a {
    color: inherit;
    text-decoration: none
}

img {
    max-width: 100%;
    display: block
}

body.modal-open {
    overflow: hidden
}

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px
}

/* Screen reader only (for live status, etc.) */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* =======================================================================
   AMBIENT BACKGROUND
   ======================================================================= */
.AegisBG {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none
}

    .AegisBG .bg-deep {
        position: absolute;
        inset: 0;
        filter: blur(2px) saturate(.9);
        opacity: .22;
        background-image: radial-gradient(900px 600px at 50% 40%, rgba(255,255,255,.10), transparent), linear-gradient(#010207,#040815);
        animation: driftDeep 36s ease-in-out infinite alternate;
    }

    .AegisBG .bg-near {
        position: absolute;
        inset: 0;
        opacity: .26;
        background-image: radial-gradient(1100px 700px at 70% 20%, rgba(145,171,255,.22), transparent 60%), radial-gradient(900px 600px at 30% 80%, rgba(68,114,255,.20), transparent 60%);
        animation: driftNear 28s ease-in-out infinite alternate;
    }

    .AegisBG .bg-stars {
        position: absolute;
        inset: -20% -20%;
        opacity: .22;
        background-image: radial-gradient(1px 1px at 40px 60px, rgba(255,255,255,.9) 100%, transparent 0), radial-gradient(1px 1px at 110px 80px, rgba(255,255,255,.7) 100%, transparent 0), radial-gradient(1px 1px at 160px 140px, rgba(255,255,255,.8) 100%, transparent 0);
        background-size: 220px 220px;
        background-repeat: repeat;
        animation: starsPan 60s linear infinite;
    }

@keyframes driftDeep {
    from {
        transform: translateY(0)
    }

    to {
        transform: translateY(-14px)
    }
}

@keyframes driftNear {
    from {
        transform: translateY(0)
    }

    to {
        transform: translateY(22px)
    }
}

@keyframes starsPan {
    from {
        background-position: 0 0,0 0,0 0
    }

    to {
        background-position: -220px 120px,220px -140px,-180px -110px
    }
}

/* =======================================================================
   BUTTONS
   ======================================================================= */
.btn {
    display: inline-block;
    padding: .9rem 1.5rem;
    border-radius: 12px;
    font-weight: 800;
    border: 2px solid transparent;
    transition: transform .2s ease,background .2s ease,color .2s ease,border-color .2s ease;
    text-decoration: none
}

    .btn:disabled, .btn[disabled] {
        opacity: .55;
        cursor: not-allowed;
    }

.btn-primary {
    background: var(--brand);
    color: #000
}

    .btn-primary:hover {
        transform: translateY(-2px);
        filter: brightness(1.06)
    }

.btn-ghost {
    background: transparent;
    color: var(--ink-strong);
    border-color: var(--line-soft)
}

    .btn-ghost:hover {
        background: rgba(255,255,255,.08)
    }

.glow {
    position: relative
}

    .glow::after {
        content: "";
        position: absolute;
        inset: -2px;
        border-radius: 16px;
        background: linear-gradient(135deg, rgba(242,163,101,.8), rgba(146,170,255,.7));
        filter: blur(14px);
        opacity: .35;
        z-index: -1
    }

.btn-s {
    padding: .45rem .7rem;
    border-radius: 8px;
    font-size: .92rem;
    font-weight: 800
}

.compact-xs {
    padding: .5rem .8rem;
    border-radius: 8px;
    font-size: .9rem
}

/* =======================================================================
   LAYOUT
   ======================================================================= */
.lf-shell {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 12px
}

.lf-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px
}

.lf-card {
    background: var(--panel);
    border: 1px solid var(--line-faint);
    border-radius: 14px;
    padding: 16px;
    box-shadow: var(--shadow)
}

.muted {
    color: var(--ink-dim)
}

h1, h2, h3, strong {
    color: var(--ink-strong)
}

/* =======================================================================
   INPUTS
   ======================================================================= */
.input {
    padding: .68rem .85rem;
    border-radius: 10px;
    border: 1px solid var(--line-soft);
    background: rgba(255,255,255,.08);
    color: var(--ink-strong);
    font-size: 15px;
    width: 100%
}

    .input::placeholder {
        color: #d7e0ff
    }

.input-sm {
    padding: .5rem .7rem;
    font-size: 14px
}

.textarea {
    resize: vertical;
    min-height: 120px
}

/* Compact widths */
.compact, .compact-xs, .compact-sm, .compact-md {
    width: auto;
    justify-self: start
}

.compact-sm {
    min-width: 140px
}

.compact-md {
    min-width: 180px
}

/* Select styling */
select.input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2.2rem;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 20 20" fill="none"><path d="M5.5 7.5L10 12l4.5-4.5" stroke="%23eaf0ff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
    background-repeat: no-repeat;
    background-position: right .7rem center;
    background-size: 14px;
}

    select.input::-ms-expand {
        display: none
    }

    select.input option {
        background: #2a3166;
        color: var(--ink-strong)
    }

    select.input:disabled {
        opacity: .6
    }

    select.input:focus {
        border-color: #b9c6ff
    }

/* =======================================================================
   GRID / TABLES
   ======================================================================= */
.grid {
    display: grid;
    gap: 10px
}

.grid-4 {
    grid-template-columns: repeat(4,minmax(0,1fr))
}

.grid-2 {
    grid-template-columns: repeat(2,1fr)
}

.grid > * {
    min-width: 0
}

.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap
}

.toolbar-grid {
    display: grid;
    grid-template-columns: 220px 1fr auto auto;
    gap: 10px;
    align-items: center
}

.table-responsive {
    overflow-x: auto
}

table {
    width: 100%;
    border-collapse: collapse
}

th, td {
    padding: 10px;
    border-bottom: 1px solid var(--line-faint);
    vertical-align: top
}

th {
    color: var(--ink-strong);
    font-weight: 800
}

.roles-row td {
    background: rgba(255,255,255,.05)
}

.th-select {
    width: 110px
}

.th-employees {
    width: 140px
}

.th-leads {
    width: 120px
}

.th-actions {
    width: 220px
}

.th-notes {
    width: 120px
}

/* Filter bar */
.filterbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap
}

/* =======================================================================
   CHIPS
   ======================================================================= */
.chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .18rem .55rem;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    font-size: .82rem;
    margin: .12rem .25rem .12rem 0;
    background: rgba(255,255,255,.06);
    color: var(--ink)
}

    .chip.brand {
        border-color: var(--brand);
        background: rgba(242,163,101,.22);
        color: #fff
    }

/* Chipbox */
.chipbox.input {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px;
    min-height: 44px;
    position: relative
}

.chipbox-input {
    flex: 1 1 160px;
    min-width: 140px;
    background: transparent;
    border: 0;
    outline: none;
    color: var(--ink-strong);
    font: inherit;
    padding: .35rem .2rem
}

.chip-remove {
    background: transparent;
    border: 0;
    color: var(--ink-strong);
    font-weight: 900;
    padding: 0 .25rem;
    cursor: pointer
}

    .chip-remove:hover {
        color: #fff
    }

.selected-row {
    outline: 2px solid var(--brand);
    outline-offset: -2px
}

.clickable {
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px
}

/* =======================================================================
   PACKS
   ======================================================================= */
.packs {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(140px,1fr));
    gap: 10px
}

.pack {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    user-select: none;
    background: rgba(255,255,255,.09)
}

    .pack input {
        display: none
    }

    .pack .big {
        font-weight: 900;
        font-size: 1.15rem;
        line-height: 1;
        color: #fff
    }

    .pack .price {
        font-size: .95rem;
        color: #e6ecff
    }

    .pack.selected {
        border-color: var(--brand);
        box-shadow: 0 0 0 2px rgba(242,163,101,.45) inset;
        background: rgba(0,0,0,.25)
    }

.hint {
    font-size: .92rem;
    color: #d6ddff
}

.preview-row td {
    background: rgba(242,163,101,.08)
}

/* =======================================================================
   TABS
   ======================================================================= */
.tabs {
}

.tabs-nav {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--line-faint);
    margin-bottom: 10px
}

.tab-btn {
    position: relative;
    padding: .55rem .9rem;
    border-radius: 10px 10px 0 0;
    background: rgba(255,255,255,.06);
    border: 1px solid var(--line-faint);
    border-bottom: none;
    color: var(--ink-strong);
    font-weight: 800
}

    .tab-btn:focus-visible {
        outline-color: currentColor
    }

.tab-btn--pending {
    background: linear-gradient(180deg, rgba(242,163,101,.14), rgba(255,255,255,.06));
    border-color: rgba(242,163,101,.35);
    color: #fff
}

.tab-btn--open {
    background: linear-gradient(180deg, rgba(138,160,255,.16), rgba(255,255,255,.06));
    border-color: rgba(138,160,255,.38);
    color: #fff
}

.tab-btn--actioned {
    background: linear-gradient(180deg, rgba(68,209,154,.18), rgba(255,255,255,.06));
    border-color: rgba(68,209,154,.40);
    color: #fff
}

.tab-btn--archived {
    background: linear-gradient(180deg, rgba(154,163,178,.18), rgba(255,255,255,.06));
    border-color: rgba(154,163,178,.42);
    color: #fff
}

.tab-btn[aria-selected="true"] {
    background: var(--panel-strong);
    border-color: var(--line-soft);
    box-shadow: 0 -2px 12px rgba(0,0,0,.25) inset
}

.tab-btn--pending[aria-selected="true"] {
    box-shadow: 0 -3px 0 var(--accent-pending) inset, 0 -1px 0 rgba(255,255,255,.06) inset
}

.tab-btn--open[aria-selected="true"] {
    box-shadow: 0 -3px 0 var(--accent-open) inset, 0 -1px 0 rgba(255,255,255,.06) inset
}

.tab-btn--actioned[aria-selected="true"] {
    box-shadow: 0 -3px 0 var(--accent-actioned) inset, 0 -1px 0 rgba(255,255,255,.06) inset
}

.tab-btn--archived[aria-selected="true"] {
    box-shadow: 0 -3px 0 var(--accent-archived) inset, 0 -1px 0 rgba(255,255,255,.06) inset
}

.tab-badge {
    display: inline-block;
    min-width: 22px;
    padding: .1rem .45rem;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    border: 1px solid var(--line-soft);
    font-size: .8rem;
    margin-left: .4rem;
    color: #fff
}

.tab-badge--pending {
    background: rgba(242,163,101,.22);
    border-color: rgba(242,163,101,.6)
}

.tab-badge--open {
    background: rgba(138,160,255,.22);
    border-color: rgba(138,160,255,.6)
}

.tab-badge--actioned {
    background: rgba(68,209,154,.22);
    border-color: rgba(68,209,154,.65)
}

.tab-badge--archived {
    background: rgba(154,163,178,.22);
    border-color: rgba(154,163,178,.65)
}

.tab-panel[hidden] {
    display: none !important
}

.tab-panel--pending {
    border-top: 2px solid var(--accent-pending);
    padding-top: 10px
}

.tab-panel--open {
    border-top: 2px solid var(--accent-open);
    padding-top: 10px
}

.tab-panel--actioned {
    border-top: 2px solid var(--accent-actioned);
    padding-top: 10px
}

.tab-panel--archived {
    border-top: 2px solid var(--accent-archived);
    padding-top: 10px
}

.tab-panel--pending thead th {
    border-bottom-color: rgba(242,163,101,.28)
}

.tab-panel--open thead th {
    border-bottom-color: rgba(138,160,255,.28)
}

.tab-panel--actioned thead th {
    border-bottom-color: rgba(68,209,154,.30)
}

.tab-panel--archived thead th {
    border-bottom-color: rgba(154,163,178,.30)
}

/* =======================================================================
   STATUS CHIPS
   ======================================================================= */
.status-chip {
    display: inline-block;
    padding: .18rem .55rem;
    border-radius: 999px;
    font-size: .82rem;
    border: 1px solid var(--line-soft);
    background: rgba(255,255,255,.06);
    color: var(--ink)
}

.status-new {
    border-color: var(--accent-open);
    background: rgba(138,160,255,.18)
}

.status-actioned {
    border-color: var(--accent-actioned);
    background: rgba(68,209,154,.20)
}

.status-archived {
    border-color: var(--accent-archived);
    background: rgba(154,163,178,.22)
}

/* =======================================================================
   MARKET SWITCHER
   ======================================================================= */
.market-switch {
    display: inline-flex;
    gap: 8px;
    padding: 6px;
    border: 1px solid var(--line-faint);
    border-radius: 12px;
    background: var(--panel-strong);
    margin-bottom: 12px
}

.market-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: .5rem .8rem;
    border: 1px solid var(--line-faint);
    border-radius: 10px;
    background: rgba(255,255,255,.06);
    color: var(--ink-strong);
    font-weight: 800;
    position: relative
}

    .market-pill[aria-selected="true"] {
        border-color: var(--brand);
        box-shadow: 0 0 0 2px rgba(242,163,101,.35) inset;
        background: linear-gradient(180deg,#3f498f,#333b79)
    }

    .market-pill[aria-disabled="true"] {
        opacity: .6;
        filter: grayscale(100%);
        cursor: not-allowed
    }

        .market-pill[aria-disabled="true"]::after {
            content: attr(data-tip);
            position: absolute;
            left: 50%;
            bottom: calc(100% + 8px);
            transform: translateX(-50%);
            background: var(--panel-strong);
            color: var(--ink-strong);
            border: 1px solid var(--line-soft);
            padding: 4px 8px;
            border-radius: 8px;
            white-space: nowrap;
            font-size: .85rem;
            opacity: 0;
            pointer-events: none;
            transition: opacity .15s ease;
        }

            .market-pill[aria-disabled="true"]:hover::after,
            .market-pill[aria-disabled="true"]::after:focus-visible {
                opacity: 1
            }

/* Flags */
.flag-img {
    width: 28px;
    height: auto;
    aspect-ratio: 2/1;
    border-radius: 2px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
    display: inline-block
}

/* =======================================================================
   NOTES UI
   ======================================================================= */
.td-notes {
    text-align: center
}

.note-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .25rem .55rem;
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    background: rgba(255,255,255,.06);
    color: var(--ink-strong);
    font-weight: 800;
    cursor: pointer
}

    .note-pill:hover {
        background: rgba(255,255,255,.12)
    }

.note-count {
    min-width: 1.2rem;
    display: inline-block;
    text-align: center
}

.notes-side {
    width: min(520px,90vw)
}

    .notes-side.open {
        transform: translateX(0)
    }

.notes-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: var(--panel-strong);
    border-bottom: 1px solid rgba(255,255,255,.12)
}

.notes-close {
    margin-left: auto;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.7);
    background: rgba(255,255,255,.22);
    color: var(--ink-strong);
    cursor: pointer;
    transition: background .15s ease, transform .08s ease;
    font-size: 20px;
    line-height: 1
}

    .notes-close:hover {
        background: rgba(255,255,255,.3)
    }

.notes-body {
    padding: 14px;
    display: grid;
    gap: 12px
}

.notes-list {
    display: grid;
    gap: 10px
}

.note-card {
    background: rgba(255,255,255,.06);
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 10px
}

.note-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--ink-dim);
    margin-bottom: 6px
}

.note-text {
    white-space: pre-wrap
}

/* =======================================================================
   GENERIC RIGHT SIDE PANEL
   ======================================================================= */
.side {
    position: fixed;
    top: 0;
    right: 0;
    width: min(640px,100%);
    height: 100%;
    background: var(--panel-strong);
    border-left: 1px solid rgba(255,255,255,.15);
    box-shadow: var(--shadow);
    transform: translateX(100%);
    transition: transform .25s ease;
    z-index: 10000;
    overflow: auto
}

    .side.open {
        transform: translateX(0)
    }

.side-header {
    position: sticky;
    top: 0;
    background: var(--panel-strong);
    padding: 14px;
    border-bottom: 1px solid rgba(255,255,255,.12)
}

.side-body {
    padding: 14px;
    display: grid;
    gap: 12px
}

.panel-block {
    background: rgba(255,255,255,.06);
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 12px
}

.pre-json {
    white-space: pre-wrap;
    margin: 0
}

/* Scrim for side/modal if needed */
.side-scrim {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: none;
    z-index: 9999
}

    .side-scrim.open {
        display: block
    }

/* =======================================================================
   UTILITIES
   ======================================================================= */
.m-0 {
    margin: 0 !important
}

.mb-8 {
    margin-bottom: 8px !important
}

.mb-10 {
    margin-bottom: 10px !important
}

.mt-10 {
    margin-top: 10px !important
}

.mt-12 {
    margin-top: 12px !important
}

.mt-14 {
    margin-top: 14px !important
}

.mt-16 {
    margin-top: 16px !important
}

.ml-8 {
    margin-left: 8px !important
}

.ml-auto {
    margin-left: auto !important
}

.nowrap {
    white-space: nowrap !important
}

.justify-between {
    justify-content: space-between !important
}

.justify-end {
    justify-content: flex-end !important
}

.hidden {
    display: none !important
}

.span-2 {
    grid-column: span 2
}

.span-4 {
    grid-column: 1 / -1
}

.inline-flex {
    display: inline-flex
}

.align-center {
    align-items: center
}

.gap-6 {
    gap: 6px
}

.row-center {
    display: inline-flex;
    align-items: center;
    gap: 8px
}

.truncate {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

/* Summary box */
.summary-box {
    background: var(--panel-strong);
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 12px;
    color: var(--ink-strong)
}

    .summary-box strong {
        color: #fff
    }

/* =======================================================================
   MODAL
   ======================================================================= */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;
    z-index: 1000;
    background: rgba(0,0,0,.48);
    backdrop-filter: blur(6px) saturate(.95);
    -webkit-backdrop-filter: blur(6px) saturate(.95);
    padding: 16px
}

    .modal.open {
        display: grid
    }

    .modal::before {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        background: radial-gradient(1200px 800px at 50% 22%, rgba(0,0,0,.18), transparent 70%)
    }

    .modal .panel {
        width: min(740px,95vw);
        background: linear-gradient(180deg,#3b478d,#313a75);
        border: 1px solid rgba(255,255,255,.65);
        border-radius: 16px;
        padding: 18px;
        box-shadow: 0 60px 160px rgba(0,0,0,.85),0 0 0 1px rgba(255,255,255,.06) inset;
        color: var(--ink-strong)
    }

.modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px
}

    .modal-header h3 {
        margin: 0;
        color: var(--ink-strong)
    }

.modal .muted {
    color: #e4ebff
}

.modal-close {
    margin-left: auto;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.7);
    background: rgba(255,255,255,.22);
    color: var(--ink-strong);
    cursor: pointer;
    transition: background .15s ease, transform .08s ease
}

    .modal-close:hover {
        background: rgba(255,255,255,.3)
    }

    .modal-close:active {
        transform: scale(.98)
    }

.modal .input {
    background: #46539f;
    border-color: #9fb1ff;
    color: #fbfcff;
    font-weight: 600;
    letter-spacing: .01em
}

    .modal .input::placeholder {
        color: #f0f4ff
    }

.modal .btn {
    background: rgba(255,255,255,.2);
    border-color: rgba(255,255,255,.55);
    color: #fff
}

    .modal .btn.btn-primary {
        background: var(--brand);
        border-color: var(--brand);
        color: #000
    }

.modal .pack {
    background: #3d4992;
    border-color: #8aa0ff
}

    .modal .pack .big {
        color: #ffffff
    }

    .modal .pack .price {
        color: #f0f4ff
    }

    .modal .pack.selected {
        background: rgba(242,163,101,.3);
        border-color: var(--brand);
        box-shadow: 0 0 0 2px rgba(242,163,101,.62) inset
    }

/* =======================================================================
   ADMIN HELPERS
   ======================================================================= */
.admin-view .lf-shell {
    max-width: 1200px;
    margin: 32px auto
}

.pill {
    display: inline-block;
    padding: .2rem .6rem;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px;
    font-size: .8rem;
    background: rgba(255,255,255,.06)
}
    /* highlight pill when we mark "Default" */
    .pill.brand {
        border-color: var(--brand);
        background: rgba(242,163,101,.22);
        color: #fff;
    }

.selcol {
    width: 42px;
    text-align: center
}

.row-selected {
    outline: 2px solid var(--brand);
    outline-offset: -2px
}

.bulk-actions {
    display: none;
    gap: 10px;
    align-items: center;
    margin: 8px 0 6px 0
}

    .bulk-actions.visible {
        display: flex
    }

    .bulk-actions .btn-danger {
        box-shadow: 0 0 0 2px rgba(255,255,255,.06) inset
    }

/* Styled suggestion dropdown */
.lf-suggest {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--panel-strong);
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    box-shadow: var(--shadow);
    max-height: 320px;
    overflow: auto;
    padding: 6px;
    z-index: 2000
}

    .lf-suggest.hidden {
        display: none
    }

.lf-suggest__item {
    display: grid;
    grid-template-columns: 86px 1fr;
    gap: 8px;
    align-items: start;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    user-select: none
}

    .lf-suggest__item .code {
        text-align: right;
        font-weight: 900;
        letter-spacing: .02em;
        color: #fff
    }

    .lf-suggest__item .label {
        color: var(--ink)
    }

    .lf-suggest__item:hover, .lf-suggest__item[aria-selected="true"] {
        background: rgba(242,163,101,.18);
        border: 1px solid var(--brand)
    }

.lf-suggest__empty {
    padding: 10px;
    color: var(--ink-dim)
}

.lf-suggest kbd {
    padding: .1rem .35rem;
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    background: rgba(255,255,255,.06);
    font-size: .78rem;
    font-family: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace
}

/* =======================================================================
   COMPANY LINK + DETAILS PANEL
   ======================================================================= */
.company-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: .25rem .45rem;
    border-radius: 8px;
    border: 1px solid transparent;
    font-weight: 800;
    background: transparent;
    color: #fff;
    cursor: pointer
}

    .company-link:hover {
        background: rgba(255,255,255,.08)
    }

    .company-link:focus-visible {
        outline: 2px solid var(--brand);
        outline-offset: 2px
    }

    .company-link .company-icon {
        display: inline-grid;
        place-items: center;
        width: 18px;
        height: 18px;
        opacity: .9
    }

        .company-link .company-icon svg {
            display: block;
            width: 18px;
            height: 18px
        }

/* Company details side panel */
.company-side {
    width: min(620px,92vw)
}

.company-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: var(--panel-strong);
    border-bottom: 1px solid rgba(255,255,255,.12)
}

.company-title {
    margin: 0;
    font-size: 1.15rem;
    color: #fff
}

.company-body {
    padding: 14px;
    display: grid;
    gap: 12px
}

.company-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px
}

    .company-meta .chip {
        margin: 0
    }

.company-section {
    background: rgba(255,255,255,.06);
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 12px
}

    .company-section h5 {
        margin: 0 0 8px 0;
        font-size: 1rem;
        color: #fff
    }

.kv {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 8px 12px
}

    .kv .k {
        color: var(--ink-dim)
    }

    .kv .v {
        color: var(--ink-strong)
    }

.company-loader {
    padding: 16px;
    color: var(--ink-dim)
}

/* =======================================================================
   METRICS CARDS
   ======================================================================= */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
    gap: 10px
}

.kpi {
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 12px;
    background: rgba(255,255,255,.06)
}

    .kpi .big {
        font-size: 1.4rem;
        font-weight: 900;
        color: #fff
    }

    .kpi .muted {
        font-size: .85rem
    }

/* Editable indicator (pencil) */
.editable .edit-ic {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--line-soft);
    background: rgba(255,255,255,.08);
    cursor: pointer;
    position: relative
}

    .editable .edit-ic::before {
        content: "";
        position: absolute;
        inset: 0;
        mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25Zm2.92 2.33h-.5V19.1l9.58-9.58.5.5-9.58 9.58Zm10.27-11.34.5.5 1.08-1.08-.5-.5-1.08 1.08Z" fill="%23eaf0ff"/></svg>') center/16px 16px no-repeat;
        background: var(--ink);
        opacity: .9;
    }

    .editable .edit-ic:hover {
        background: rgba(255,255,255,.15)
    }

/* Accordion */
.acc {
    border: 1px solid var(--line-faint);
    border-radius: 10px;
    background: rgba(255,255,255,.04);
    padding: 0 10px 10px 10px;
    margin-top: 10px
}

    .acc > summary {
        list-style: none;
        cursor: pointer;
        font-weight: 800;
        padding: 10px 0;
        display: flex;
        align-items: center;
        gap: 10px
    }

        .acc > summary::before {
            content: "▸";
            display: inline-block;
            transform: translateY(-1px);
            margin-right: 2px;
            opacity: .9
        }

    .acc[open] > summary::before {
        content: "▾"
    }

    .acc > summary small {
        font-weight: 400;
        margin-left: 6px
    }

.acc__body {
    padding-top: 6px
}

/* =======================================================================
   CREDIT SHEET
   ======================================================================= */
.sheet-scrim {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: none;
    z-index: 9999
}

    .sheet-scrim.open {
        display: block
    }

.sheet {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: min(520px,95vw);
    background: var(--panel-strong);
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 14px;
    display: none;
    z-index: 10000
}

    .sheet.open {
        display: block
    }

.sheet__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px
}

.sheet__close {
    margin-left: auto;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    border: 1px solid var(--line-soft);
    background: rgba(255,255,255,.08);
    color: #fff;
    cursor: pointer
}

    .sheet__close:hover {
        background: rgba(255,255,255,.14)
    }

.sheet__footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 10px
}

.field label {
    display: block;
    margin-bottom: 6px;
    color: var(--ink-strong);
    font-weight: 800
}

/* Minor polish */
.side .kpi .big svg {
    opacity: .9
}

.hidden {
    display: none !important
}

/* Admin panel additions (wide side) */
.side.side--wide {
    width: min(680px,95vw)
}

.side__header {
    position: sticky;
    top: 0;
    background: var(--panel-strong);
    padding: 14px;
    border-bottom: 1px solid rgba(255,255,255,.12)
}

.side__body {
    padding: 14px;
    display: grid;
    gap: 12px
}

.debug-json {
    background: rgba(255,255,255,.04);
    border: 1px solid var(--line-faint);
    border-radius: 10px;
    padding: 10px
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px,1fr));
    gap: 10px
}

.kpi {
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 12px;
    background: rgba(255,255,255,.06);
    display: flex;
    flex-direction: column;
    gap: 4px
}

    .kpi .big {
        font-size: 1.3rem;
        font-weight: 900;
        color: #fff;
        display: flex;
        align-items: center;
        gap: 8px
    }

    .kpi .muted {
        font-size: .85rem
    }

.btn-icn {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--line-soft);
    background: rgba(255,255,255,.08);
    color: #fff;
    cursor: pointer
}

    .btn-icn:hover {
        background: rgba(255,255,255,.14)
    }

.editable {
    display: flex;
    align-items: center;
    gap: 8px
}

/* Responsive */
@media (max-width:1100px) {
    .toolbar-grid {
        grid-template-columns: 1fr
    }
}

@media (max-width:900px) {
    .grid-4 {
        grid-template-columns: repeat(2,minmax(0,1fr))
    }

    .packs {
        grid-template-columns: repeat(2,1fr)
    }
}

/* Reduced motion for ambient */
@media (prefers-reduced-motion:reduce) {
    .AegisBG .bg-deep, .AegisBG .bg-near, .AegisBG .bg-stars {
        animation: none !important;
        opacity: .25
    }
}

/* Sticky horizontal scrollbar */
.table-wrap {
    position: relative
}

.sticky-xscroll {
    position: sticky;
    bottom: 0;
    height: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    border-top: 1px solid var(--line-faint);
    background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.06));
    display: none;
    z-index: 5;
}

    .sticky-xscroll.show {
        display: block
    }

    .sticky-xscroll .spacer {
        height: 1px
    }

#gridScroll {
    padding-bottom: 6px
}

#sicSuggest {
    z-index: 30
}

#gridScroll {
    overflow-x: auto;
    padding-bottom: 8px;
    -ms-overflow-style: none;
    scrollbar-width: none
}

    #gridScroll::-webkit-scrollbar {
        height: 0
    }

#sicSuggest {
    z-index: 30
}

/* =======================================================================
   LOADING OVERLAY (Aurora Ring)
   ======================================================================= */
.lf-loading-scrim {
    position: fixed;
    inset: 0;
    background: radial-gradient(1200px 800px at 50% 40%, rgba(10,12,28,.66), rgba(0,0,0,.28) 70%);
    backdrop-filter: blur(2.4px) saturate(1.05);
    -webkit-backdrop-filter: blur(2.4px) saturate(1.05);
    display: grid;
    place-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .16s ease, visibility 0s linear .16s;
    z-index: 20000;
}

    .lf-loading-scrim.open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: opacity .16s ease
    }

.lf-loading {
    display: grid;
    gap: 10px;
    place-items: center;
    padding: 16px 18px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(63,73,143,.24), rgba(47,56,116,.28));
    border: 1px solid rgba(255,255,255,.20);
    box-shadow: 0 30px 120px rgba(0,0,0,.7), inset 0 0 0 1px rgba(255,255,255,.06);
}

.lf-loading__ring {
    width: min(128px, 28vmin);
    aspect-ratio: 1;
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    filter: drop-shadow(0 0 14px rgba(146,170,255,.35));
}

    .lf-loading__ring::before {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 50%;
        background: conic-gradient(from 0deg, var(--brand), #8aa0ff, #44d19a, var(--brand));
        -webkit-mask: radial-gradient(farthest-side, transparent 62%, #000 64%);
        mask: radial-gradient(farthest-side, transparent 62%, #000 64%);
        animation: lfSpin 1.15s linear infinite;
    }

.lf-loading__text {
    letter-spacing: .06em;
    font-weight: 800;
    font-size: .95rem;
    color: var(--ink-strong);
    opacity: .95
}

@keyframes lfSpin {
    to {
        transform: rotate(1turn)
    }
}

@media (prefers-reduced-motion:reduce) {
    .lf-loading__ring::before {
        animation: none
    }
}

/* =======================================================================
   LEFT NAV RAIL — ALWAYS OPEN (no collapsed state)
   ======================================================================= */

/* App-specific constants for the rail (always open) */
:root {
    --lf-topbar-h: 70px;
    --lf-nav-w: 280px; /* width of the open rail */
    --lf-nav-icon: 18px; /* icon size */
    --lf-nav-gap: 10px; /* icon <-> label gap */
    --lf-nav-pad-x: 16px;
    --lf-nav-item-h: 46px;
    --lf-nav-font: 14px;
    --lf-label-max: calc(var(--lf-nav-w) - (var(--lf-nav-pad-x) * 2) - var(--lf-nav-icon) - var(--lf-nav-gap));
}

/* Context element */
.lf-app-shell {
    position: relative
}

/* Fixed left rail under the global header */
.lf-nav-rail {
    position: fixed;
    top: var(--lf-topbar-h);
    left: 0;
    bottom: 0;
    width: var(--lf-nav-w);
    background: var(--panel-strong);
    border-right: 1px solid var(--line-faint);
    box-shadow: var(--shadow);
    padding: 10px 10px 12px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 10px;
    z-index: 9000;
    overflow: hidden;
}

    .lf-nav-rail .lf-nav-logo {
        position: relative;
        display: flex;
        align-items: center;
        gap: 10px;
        min-height: 42px;
        margin: 2px 2px 6px 2px;
        padding: 8px 10px;
        border-radius: 10px;
        background: rgba(255,255,255,.06);
        border: 1px solid var(--line-soft);
        color: var(--ink-strong);
        font-weight: 900;
        letter-spacing: .01em;
        font-size: 0; /* hide any inline text like 'LF' */
    }

        .lf-nav-rail .lf-nav-logo > :not(img) {
            display: none !important
        }

        .lf-nav-rail .lf-nav-logo img {
            width: 24px;
            height: 24px;
            object-fit: contain;
            border-radius: 4px
        }

        .lf-nav-rail .lf-nav-logo::after {
            content: attr(data-label);
            font-size: 14px;
            white-space: nowrap;
            overflow: hidden;
            max-width: var(--lf-label-max);
        }

        .lf-nav-rail .lf-nav-logo:not([data-label])::after {
            content: "LeadFuture"
        }

    /* ---- Vertical nav list (always open) ---- */
    .lf-nav-rail .lf-nav-list {
        position: static !important;
        height: auto !important;
        width: auto !important;
        justify-content: flex-start !important;
        align-items: stretch !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 10px;
        margin: 0;
        padding: 0;
    }

        .lf-nav-rail .lf-nav-list a,
        .lf-nav-rail .lf-nav-list button {
            position: relative;
            display: flex;
            align-items: center;
            gap: var(--lf-nav-gap);
            width: 100%;
            min-height: var(--lf-nav-item-h);
            text-align: left;
            padding: 8px var(--lf-nav-pad-x);
            border-radius: 12px;
            background: transparent;
            border: none;
            color: var(--ink-strong);
            font-weight: 800;
            white-space: nowrap;
            overflow: visible;
            font-size: var(--lf-nav-font);
        }

            .lf-nav-rail .lf-nav-list a::before,
            .lf-nav-rail .lf-nav-list button::before {
                content: "";
                position: absolute;
                left: var(--lf-nav-pad-x);
                top: 50%;
                transform: translateY(-50%);
                height: calc(var(--lf-nav-item-h) - 10px);
                width: calc(100% - var(--lf-nav-pad-x) * 2);
                border-radius: 12px;
                background: rgba(255,255,255,.06);
                border: 1px solid var(--line-soft);
                transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
                z-index: 0;
            }

            .lf-nav-rail .lf-nav-list a > *, .lf-nav-rail .lf-nav-list button > * {
                position: relative;
                z-index: 1
            }

        .lf-nav-rail .lf-nav-list svg,
        .lf-nav-rail .lf-nav-list .ic,
        .lf-nav-rail .lf-nav-list img {
            width: var(--lf-nav-icon);
            height: var(--lf-nav-icon);
            opacity: .9;
            flex: 0 0 var(--lf-nav-icon)
        }

        .lf-nav-rail .lf-nav-list .is-active::before,
        .lf-nav-rail .lf-nav-list [aria-current="page"]::before,
        .lf-nav-rail .lf-nav-list [aria-selected="true"]::before {
            border-color: var(--brand);
            background: rgba(242,163,101,.22);
            box-shadow: 0 0 0 2px rgba(242,163,101,.35) inset;
        }

        .lf-nav-rail .lf-nav-list a:hover::before,
        .lf-nav-rail .lf-nav-list button:hover::before {
            background: rgba(255,255,255,.10)
        }

/* MAIN CONTENT SHIFT (always open) */
.lf-main {
    margin-left: var(--lf-nav-w)
}
