        /* Professional Scout Pins */
        .scout-pin {
            border-radius: 50%;
            border: 2px solid white;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            color: white;
            font-size: 10px;
            transition: transform 0.2s;
        }

        .scout-pin:hover {
            transform: scale(1.1);
            z-index: 999 !important;
        }

        .pin-intel {
            background: linear-gradient(135deg, #3b82f6, #1d4ed8);
        }

        .pin-hunter {
            background: linear-gradient(135deg, #a855f7, #7e22ce);
        }

        /* Popup Styling */
        .scout-popup .leaflet-popup-content-wrapper {
            padding: 0;
            overflow: hidden;
            border-radius: 8px;
        }

        .scout-popup .leaflet-popup-content {
            margin: 0;
            width: 280px !important;
        }

        /* FIELD SCOUT 6.0 STYLES */
        .scout-card {
            background: white;
            border-left: 4px solid #cbd5e1;
            transition: all 0.2s;
            position: relative;
            overflow: hidden;
        }

        .scout-card.intel {
            border-left-color: #3b82f6;
        }

        .scout-card.hunter {
            border-left-color: #a855f7;
        }

        .scout-card:hover {
            transform: translateX(2px);
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        }

        /* Stop Number Badge */
        .stop-badge {
            position: absolute;
            right: -10px;
            top: -10px;
            width: 40px;
            height: 40px;
            background: #f1f5f9;
            border-radius: 50%;
            display: flex;
            align-items: flex-end;
            justify-content: flex-start;
            padding: 0 0 8px 10px;
            font-weight: 900;
            font-size: 14px;
            color: #94a3b8;
            z-index: 0;
        }

        /* Popup "Add All" Button */
        .btn-gold-action {
            background: linear-gradient(135deg, #C5A059, #b49048);
            color: #0F172A;
            font-weight: 800;
            font-size: 10px;
            padding: 4px 10px;
            border-radius: 4px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
            transition: transform 0.1s;
        }

        .btn-gold-action:hover {
            transform: scale(1.05);
            color: white;
        }

        /* Key Contacts card + rows (UI-only; JS untouched) */
        #peopleList>div {
            border: 1px solid rgba(255, 255, 255, .10) !important;
            background: rgba(15, 23, 42, .55) !important;
            border-radius: 14px !important;
            padding: 10px 12px !important;
            margin: 0 0 8px 0 !important;
        }

        #peopleList>div.border-b {
            border-bottom: 0 !important;
        }

        #peopleList b {
            color: rgba(255, 255, 255, .92) !important;
            font-weight: 600 !important;
        }

        #peopleList .text-gray-500 {
            color: rgba(255, 255, 255, .60) !important;
        }

        #peopleList button {
            width: 30px !important;
            height: 30px !important;
            display: inline-flex !important;
            align-items: center !important;
            justify-content: center !important;
            border-radius: 10px !important;
            background: rgba(255, 255, 255, .06) !important;
            border: 1px solid rgba(255, 255, 255, .12) !important;
            margin-left: 6px !important;
            font-size: 0 !important;
            /* hide E/D text */
            line-height: 0 !important;
            transition: transform .15s ease, background .15s ease, border-color .15s ease;
        }

        #peopleList button:hover {
            transform: translateY(-1px);
            background: rgba(255, 255, 255, .10) !important;
            border-color: rgba(255, 255, 255, .18) !important;
        }

        #peopleList button.text-blue-500::before {
            content: "✎";
            font-size: 14px;
            line-height: 1;
        }

        #peopleList button.text-red-500::before {
            content: "🗑️";
            font-size: 14px;
            line-height: 1;
        }


        /* KEY CONTACTS INLINE EDITOR */
        .kc-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: .75rem;
            padding: .5rem .5rem;
            border-bottom: 1px solid rgba(255, 255, 255, .06)
        }

        .kc-row:last-child {
            border-bottom: none
        }

        .kc-main {
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: .125rem
        }

        .kc-name {
            font-size: .75rem;
            color: rgba(255, 255, 255, .92);
            line-height: 1.1
        }

        .kc-meta {
            font-size: .7rem;
            color: rgba(255, 255, 255, .60);
            line-height: 1.1;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 260px
        }

        .kc-side {
            display: flex;
            align-items: center;
            gap: .35rem
        }

        .kc-email {
            font-size: .72rem;
            color: rgba(255, 255, 255, .70);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 220px
        }

        .kc-icon {
            width: 34px;
            height: 30px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 10px;
            border: 1px solid rgba(255, 255, 255, .10);
            background: rgba(255, 255, 255, .04);
            transition: transform .12s ease, background .12s ease, border-color .12s ease
        }

        .kc-icon:hover {
            transform: translateY(-1px);
            background: rgba(255, 255, 255, .07);
            border-color: rgba(255, 255, 255, .16)
        }

        .kc-icon-edit {
            color: rgba(255, 255, 255, .82)
        }

        .kc-icon-del {
            color: rgba(239, 68, 68, .95)
        }

        .kc-row-edit {
            align-items: flex-start
        }

        .kc-fields {
            display: grid;
            grid-template-columns: 1fr 1fr 1.2fr;
            gap: .4rem;
            flex: 1;
            min-width: 0
        }

        .kc-in {
            width: 100%;
            height: 34px;
            padding: 0 .55rem;
            border-radius: 10px;
            border: 1px solid rgba(255, 255, 255, .12);
            background: rgba(15, 23, 42, .55);
            color: rgba(255, 255, 255, .92);
            font-size: .75rem;
            outline: none
        }

        .kc-in:focus {
            border-color: rgba(99, 102, 241, .55);
            box-shadow: 0 0 0 3px rgba(99, 102, 241, .22)
        }

        .kc-actions {
            display: flex;
            flex-direction: column;
            gap: .35rem
        }

        .kc-btn {
            height: 32px;
            padding: 0 .6rem;
            border-radius: 10px;
            border: 1px solid rgba(255, 255, 255, .12);
            background: rgba(255, 255, 255, .04);
            color: rgba(255, 255, 255, .86);
            font-size: .72rem;
            white-space: nowrap
        }

        .kc-btn:hover {
            background: rgba(255, 255, 255, .07);
            border-color: rgba(255, 255, 255, .16)
        }

        .kc-btn-primary {
            background: rgba(99, 102, 241, .18);
            border-color: rgba(99, 102, 241, .38)
        }

        .kc-btn-primary:hover {
            background: rgba(99, 102, 241, .26);
            border-color: rgba(99, 102, 241, .55)
        }

        @media (max-width: 720px) {
            .kc-fields {
                grid-template-columns: 1fr
            }

            .kc-actions {
                flex-direction: row
            }

            .kc-meta,
            .kc-email {
                max-width: 160px
            }
        }
    </style>
        /* AMBASSADOR POPUP UPGRADE */
        .scout-popup .leaflet-popup-content-wrapper {
            padding: 0;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }

        .scout-popup .leaflet-popup-content {
            width: 380px !important;
            /* Wider Canvas */
            margin: 0;
        }

        .scout-popup .leaflet-popup-tip {
            background: #0f172a;
        }

        /* Dark Tip to match header */
        .scout-popup a.leaflet-popup-close-button {
            color: white !important;
            top: 10px;
            right: 10px;
        }

        /* Flag Icon Style */
        .country-flag {
            width: 32px;
            height: 24px;
            object-fit: cover;
            border-radius: 4px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        /* [FIX] 1. CARD TITLE & CHECKBOX SAFETY */
        .company-card .card-header-row {
            display: flex !important;
            align-items: flex-start !important;
            /* Align top */
            justify-content: space-between !important;
            gap: 12px !important;
            /* Mandatory gap */
            width: 100%;
        }

        .company-card h3 {
            flex: 1 !important;
            /* Takes all available space */
            min-width: 0 !important;
            /* Allows truncation */
            word-wrap: break-word !important;
            /* Prevents overflow */
            margin-right: 8px !important;
        }

        .company-card input[type="checkbox"] {
            position: static !important;
            /* Overrides absolute positioning */
            flex-shrink: 0 !important;
            margin-top: 4px !important;
            width: 18px !important;
            height: 18px !important;
            z-index: 10 !important;
            pointer-events: auto !important;
        }

        /* [FIX] 2. MOBILE BACK BUTTON */
        .mobile-back-btn {
            display: none;
            /* Hidden on Desktop */
        }

        @media (max-width: 768px) {
            .mobile-back-btn {
                display: inline-flex;
                align-items: center;
                gap: 6px;
                background: #f1f5f9;
                color: #334155;
                padding: 6px 12px;
                border-radius: 6px;
                font-size: 13px;
                font-weight: 700;
                margin-bottom: 12px;
                width: fit-content;
                cursor: pointer;
                border: 1px solid #cbd5e1;
            }
        }

        /* [FIXED] Mobile Card Slimming Protocol */
        /* =================================================================
       AYMILA MASTER UI ENGINE (Sidebar & Mobile Cards)
       ================================================================= */

        /* 1. DESKTOP SIDEBAR (The Base) */
        @media (min-width: 769px) {
            .side-panel {
                position: relative !important;
                /* Sit inside the flex layout */
                top: 0;
                left: 0;
                bottom: 0;
                width: 280px;
                height: 100% !important;
                background: #0f172a;
                z-index: 40;
                border-right: 1px solid #1e293b;
                transform: none !important;
                /* FORCE VISIBLE */
                display: flex !important;
                flex-direction: column;
                flex-shrink: 0;
            }
        }

        /* 2. MOBILE OVERRIDES (The Fix) */
        @media (max-width: 768px) {
            .side-panel {
                position: fixed !important;
                top: 0 !important;
                left: 0 !important;
                bottom: 0 !important;
                width: 85% !important;
                max-width: 300px !important;
                height: 100vh !important;
                background: #0f172a !important;
                box-shadow: 10px 0 50px rgba(0, 0, 0, 0.9) !important;
                transform: translateX(-100%);
                /* Hidden by default on Mobile */
                z-index: 99999 !important;
                border-right: 1px solid #C5A059;
                transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            }

            .side-panel.open {
                transform: translateX(0) !important;
            }

            /* HEADER FIX */
            #app>div:first-child {
                flex-wrap: wrap !important;
                gap: 8px;
            }

            /* CARD SLIMMING */
            #intelligenceGrid,
            #hunterGrid {
                grid-template-columns: 1fr !important;
                gap: 8px !important;
                padding-bottom: 120px;
            }

            .company-card {
                min-height: 0 !important;
                height: auto !important;
            }

            .company-card .card-content {
                padding: 8px 12px !important;
            }

            /* HIDE NOISE */
            .company-card p.text-xs,
            .company-card p.text-\[10px\],
            .company-card .mt-2.flex.justify-between,
            .company-card .comp-badge,
            .company-card .flag-bg,
            .company-card .logo-bg {
                display: none !important;
            }

            /* RESIZE TEXT */
            .company-card h3 {
                font-size: 14px !important;
                margin: 0 !important;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                max-width: 160px;
            }

            .company-card .flex.gap-3.items-center {
                margin: 0 !important;
                gap: 10px !important;
            }

            .company-card a span {
                display: none !important;
            }

            /* MODALS */
            .modal .bg-white {
                width: 100% !important;
                height: 100dvh !important;
                border-radius: 0;
            }

            #modalContent {
                padding: 16px !important;
                flex: 1;
                overflow-y: auto;
            }

            #peopleList {
                max-height: 100px !important;
            }
        }

        /* SMART FILTERS */
        .smart-bar {
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
            padding: 10px 0;
            border-bottom: 1px solid #e2e8f0;
            margin-bottom: 16px;
            align-items: center;
            justify-content: space-between;
        }

        .alpha-btn {
            font-family: monospace;
            font-size: 10px;
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
            color: #64748b;
            cursor: pointer;
            transition: 0.2s;
            font-weight: 700;
        }

        .alpha-btn:hover {
            background: #e2e8f0;
            color: #0f172a;
        }

        .alpha-btn.active {
            background: #C5A059;
            color: #0B1120;
        }

        .sort-select {
            background: white;
            border: 1px solid #cbd5e1;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 11px;
            font-weight: bold;
            color: #334155;
            cursor: pointer;
        }

        /* --- CORE LAYOUT --- */
        /* Use dvh (dynamic viewport height) for mobile browsers */
        body {
            font-family: 'Inter', sans-serif;
            background: radial-gradient(1200px 800px at 20% 0%, #1f2937 0%, #0b1120 55%, #05070b 100%);
            color: #e5e7eb;
            height: 100vh;
            height: 100dvh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .view-section {
            display: none;
            height: 100%;
            overflow: hidden;
            background: #e5e7eb;
            color: #0f172a !important;
            position: relative;
            margin: 12px;
            border-radius: 18px;
            box-shadow: 0 30px 60px -35px rgba(0, 0, 0, 0.6);
            border: 1px solid rgba(255, 255, 255, 0.06);
        }

        .view-section.active {
            display: flex;
            flex-direction: column;
        }

        #view-intelligence.active {
            display: flex;
            flex-direction: row;
            padding: 0;
        }

        #view-hunter.active {
            display: flex;
            flex-direction: column;
            padding: 0;
        }

        #view-kanban.active {
            display: flex;
            flex-direction: column;
            padding: 0;
            overflow: hidden;
        }

        /* KANBAN (SYSTEM) */
        #view-kanban {
            background: #e5e7eb;
        }

        #kanbanBoard.kanban-board {
            --kcol: 280px;
            --kgap: 12px;
            display: grid;
            grid-auto-flow: column;
            grid-auto-columns: var(--kcol);
            gap: var(--kgap);
            padding: 14px;
            overflow-x: auto;
            overflow-y: hidden;
            flex: 1;
            min-height: 0;
            align-items: stretch;
            scroll-snap-type: x mandatory;
            -webkit-overflow-scrolling: touch;
        }

        #kanbanBoard.kanban-board::-webkit-scrollbar {
            height: 10px;
        }

        #kanbanBoard.kanban-board::-webkit-scrollbar-thumb {
            background: rgba(15, 23, 42, 0.18);
            border-radius: 999px;
        }

        #kanbanBoard.kanban-board::-webkit-scrollbar-track {
            background: rgba(15, 23, 42, 0.06);
            border-radius: 999px;
        }

        .kanban-col {
            width: auto;
            min-width: 0;
            background: rgba(255, 255, 255, 0.82);
            border-radius: 18px;
            padding: 12px;
            display: flex;
            flex-direction: column;
            border: 1px solid rgba(15, 23, 42, 0.10);
            box-shadow: 0 18px 40px -35px rgba(15, 23, 42, 0.45);
            max-height: 100%;
            white-space: normal;
            scroll-snap-align: start;
            overflow: hidden;
        }

        .kanban-col .kcol-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 10px 10px 8px 10px;
            margin: -12px -12px 10px -12px;
            background: rgba(15, 23, 42, 0.04);
            border-bottom: 1px solid rgba(15, 23, 42, 0.08);
        }

        .kanban-col .kcol-title {
            font-weight: 900;
            font-size: 11px;
            letter-spacing: .14em;
            text-transform: uppercase;
            color: #0f172a;
            display: flex;
            align-items: center;
            gap: 8px;
            min-width: 0;
        }

        .kanban-col .kcol-dot {
            width: 8px;
            height: 8px;
            border-radius: 999px;
            flex-shrink: 0;
            box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.04);
        }

        .kanban-col .kcol-count {
            font-size: 11px;
            font-weight: 900;
            color: rgba(15, 23, 42, 0.72);
            background: rgba(255, 255, 255, 0.7);
            border: 1px solid rgba(15, 23, 42, 0.10);
            padding: 2px 10px;
            border-radius: 999px;
        }

        .kanban-col .kcol-body {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            padding-right: 4px;
        }

        .kanban-col .kcol-body::-webkit-scrollbar {
            width: 10px;
        }

        .kanban-col .kcol-body::-webkit-scrollbar-thumb {
            background: rgba(15, 23, 42, 0.14);
            border-radius: 999px;
        }

        .kanban-col .kcol-body::-webkit-scrollbar-track {
            background: rgba(15, 23, 42, 0.06);
            border-radius: 999px;
        }

        .kanban-item {
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.92) 100%);
            border: 1px solid rgba(15, 23, 42, 0.10);
            border-radius: 14px;
            padding: 12px;
            margin-bottom: 10px;
            cursor: grab;
            color: #0f172a;
            position: relative;
            box-shadow: 0 14px 26px -22px rgba(15, 23, 42, 0.35);
            transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
            overflow: hidden;
        }

        .kanban-item:active {
            cursor: grabbing;
        }

        .kanban-item:hover {
            transform: translateY(-2px);
            box-shadow: 0 26px 55px -35px rgba(15, 23, 42, 0.55);
            border-color: rgba(197, 160, 89, 0.55);
        }

        .kanban-item .kcard-top {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 10px;
        }

        .kanban-item .kcard-title {
            font-weight: 800;
            font-size: 12px;
            line-height: 1.2;
            color: #0b1120;
            min-width: 0;
        }

        .kanban-item .kcard-sub {
            font-size: 10px;
            font-weight: 700;
            color: rgba(15, 23, 42, 0.55);
            margin-top: 2px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .kanban-item .kcard-meta {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            margin-top: 10px;
            padding-top: 10px;
            border-top: 1px solid rgba(15, 23, 42, 0.06);
        }

        .kanban-item .kbadge {
            font-size: 9px;
            font-weight: 900;
            letter-spacing: .08em;
            text-transform: uppercase;
            padding: 3px 8px;
            border-radius: 999px;
            border: 1px solid rgba(15, 23, 42, 0.10);
            background: rgba(15, 23, 42, 0.04);
            color: rgba(15, 23, 42, 0.72);
        }

        .kanban-item .kbadge.hunter {
            background: rgba(168, 85, 247, 0.08);
            border-color: rgba(168, 85, 247, 0.22);
            color: rgba(88, 28, 135, 0.9);
        }

        .kc-new {
            border-top-color: #94a3b8;
        }

        .kc-qualified {
            border-top-color: #3b82f6;
        }

        .kc-contacted {
            border-top-color: #f97316;
        }

        .kc-proposal {
            border-top-color: #a855f7;
        }

        .kc-won {
            border-top-color: #22c55e;
        }

        .kc-lost {
            border-top-color: #ef4444;
        }

        /* KANBAN SCOPE BUTTONS (ONLY IN KANBAN) */
        #view-kanban .h-sub-btn {
            margin-right: 0;
            padding: 6px 10px;
            border-radius: 999px;
            border: 1px solid rgba(148, 163, 184, 0.25);
            background: rgba(15, 23, 42, 0.20);
            color: rgba(226, 232, 240, 0.85);
            font-size: 11px;
            font-weight: 900;
            letter-spacing: .08em;
            text-transform: uppercase;
        }

        #view-kanban .h-sub-btn:hover {
            background: rgba(15, 23, 42, 0.28);
            color: #ffffff;
        }

        #view-kanban .h-sub-btn.active {
            background: rgba(197, 160, 89, 0.16);
            border-color: rgba(197, 160, 89, 0.55);
            color: #ffffff;
            box-shadow: 0 18px 35px -28px rgba(197, 160, 89, 0.8);
        }

        @media (max-width: 720px) {
            #kanbanBoard.kanban-board {
                padding: 10px;
                gap: 10px;
            }

            #kanbanBoard.kanban-board {
                grid-auto-columns: calc(100vw - 44px);
            }
        }

        /* UI */
        input.edit-input,
        select.edit-input,
        textarea.edit-input {
            width: 100%;
            background: #ffffff;
            border: 1px solid #cbd5e1;
            padding: 6px 10px;
            font-family: monospace;
            font-size: 0.875rem;
            border-radius: 4px;
            color: #000000 !important;
            font-weight: 500;
        }

        .tab-btn {
            padding: 6px 12px;
            font-weight: 800;
            color: #cbd5e1;
            cursor: pointer;
            border-bottom: 0;
            border-radius: 9999px;
            transition: 0.2s;
            letter-spacing: 0.04em;
            font-size: 11px;
        }

        .tab-btn:hover {
            color: #ffffff;
            background: rgba(148, 163, 184, 0.12);
        }

        .tab-btn.active {
            color: #ffffff;
            background: linear-gradient(135deg, #ef4444, #b91c1c);
            box-shadow: 0 10px 25px -15px rgba(239, 68, 68, 0.8);
        }

        .h-sub-btn {
            font-size: 13px;
            font-weight: 700;
            color: #94a3b8;
            cursor: pointer;
            padding-bottom: 4px;
            border-bottom: 2px solid transparent;
            transition: 0.2s;
            margin-right: 20px;
        }

        .h-sub-btn:hover {
            color: white;
        }

        .h-sub-btn.active {
            color: #C5A059;
            border-color: #C5A059;
        }

        .header-filter {
            background: #334155;
            color: white;
            border: 1px solid #475569;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 12px;
            outline: none;
            cursor: pointer;
        }

        /* SIDEBAR */
        .side-panel {
            width: 280px;
            background: rgba(17, 24, 39, 0.92);
            backdrop-filter: blur(10px);
            border-right: 1px solid rgba(148, 163, 184, 0.15);
            display: flex;
            flex-direction: column;
            flex-shrink: 0;
            z-index: 20;
            height: 100%;
        }

        .side-header {
            padding: 12px 12px;
            border-bottom: 1px solid rgba(148, 163, 184, 0.15);
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: rgba(15, 23, 42, 0.9);
            flex-shrink: 0;
        }

        .side-title {
            font-size: 10px;
            font-weight: 800;
            text-transform: uppercase;
            color: #94a3b8;
            letter-spacing: 1px;
        }

        .multi-btn {
            font-size: 9px;
            padding: 2px 6px;
            border: 1px solid #475569;
            border-radius: 4px;
            color: #64748b;
            cursor: pointer;
            transition: 0.2s;
            font-weight: 700;
        }

        .multi-btn.active {
            background: #C5A059;
            color: #0B1120;
            border-color: #C5A059;
        }

        .side-list {
            overflow-y: auto;
            flex: 1;
            padding: 6px;
            min-height: 0;
        }

        .side-item {
            position: relative;
            height: 38px;
            border-radius: 10px;
            cursor: pointer;
            overflow: hidden;
            display: flex;
            align-items: center;
            padding: 0 10px;
            margin-bottom: 6px;
            border: 1px solid transparent;
            background: rgba(148, 163, 184, 0.10);
            transition: all 0.2s;
        }

        .side-item:hover {
            transform: translateX(2px);
            border-color: rgba(148, 163, 184, 0.35);
            background: rgba(148, 163, 184, 0.16);
        }

        .side-item.active {
            border-color: rgba(239, 68, 68, 0.75);
            box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35), 0 18px 35px -25px rgba(239, 68, 68, 0.9);
        }

        .side-bg {
            position: absolute;
            inset: 0;
            background-size: cover;
            opacity: 0.2;
            filter: grayscale(100%);
            pointer-events: none;
        }

        .side-item.active .side-bg {
            opacity: 0.3;
            filter: grayscale(0%);
            background-color: rgba(0, 0, 0, 0.5);
        }

        .side-text {
            position: relative;
            z-index: 10;
            font-weight: 700;
            font-size: 12px;
            color: #e2e8f0;
            width: 100%;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .side-count {
            font-size: 9px;
            opacity: 0.7;
            background: rgba(0, 0, 0, 0.5);
            padding: 1px 5px;
            border-radius: 4px;
        }

        /* CARDS */
        .company-card {
            transition: all 0.2s ease;
            position: relative;
            overflow: hidden;
            background: rgba(243, 244, 246, 0.92);
            border-radius: 16px;
            border: 1px solid rgba(15, 23, 42, 0.08);
            color: #0f172a;
            min-height: 150px;
            box-shadow: 0 12px 30px -22px rgba(15, 23, 42, 0.35);
            cursor: pointer;
            border-top: 5px solid transparent;
        }

        .company-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 28px 55px -35px rgba(15, 23, 42, 0.55);
            z-index: 10;
        }

        .logo-bg {
            position: absolute;
            top: 12px;
            right: 12px;
            width: 40px;
            height: 40px;
            background-size: contain;
            background-repeat: no-repeat;
            opacity: 0.9;
            pointer-events: none;
            background: #fff;
            padding: 2px;
            border-radius: 4px;
        }

        .flag-bg {
            position: absolute;
            inset: 0;
            opacity: 0.05;
            background-size: cover;
            pointer-events: none;
        }

        .card-content {
            position: relative;
            z-index: 2;
            padding: 16px;
        }

        .comp-badge {
            display: inline-block;
            font-size: 9px;
            font-weight: 800;
            padding: 2px 6px;
            border-radius: 4px;
            color: white;
            text-transform: uppercase;
            margin-top: 6px;
        }

        .add-card {
            border: 2px dashed #cbd5e1;
            background: #f8fafc;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            color: #94a3b8;
            min-height: 140px;
        }

        .add-card:hover {
            border-color: #C5A059;
            color: #C5A059;
            background: #fff;
        }

        /* DATA TABLE */
        .data-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 12px;
            color: #334155;
        }

        .data-table th {
            background: rgba(148, 163, 184, 0.14);
            text-align: left;
            padding: 10px;
            font-weight: 800;
            border-bottom: 1px solid rgba(15, 23, 42, 0.12);
            color: rgba(15, 23, 42, 0.65);
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: 0.12em;
        }

        .data-table td {
            padding: 10px;
            border-bottom: 1px solid rgba(15, 23, 42, 0.08);
            background: rgba(255, 255, 255, 0.9);
            cursor: pointer;
        }

        .data-table tr:hover td {
            background: rgba(239, 68, 68, 0.08);
        }

        .dt-tag {
            background: #fef3c7;
            color: #b45309;
            padding: 2px 6px;
            border-radius: 4px;
            font-weight: bold;
            font-size: 10px;
            border: 1px solid #fcd34d;
        }

        /* HISTORY TIMELINE */
        .history-timeline {
            display: flex;
            flex-direction: column;
            gap: 0;
        }

        .history-entry {
            display: flex;
            gap: 16px;
            padding: 16px;
            background: white;
            border-bottom: 1px solid #e2e8f0;
            align-items: flex-start;
            transition: 0.2s;
        }

        .history-entry:hover {
            background: #f8fafc;
        }

        .h-icon-box {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 16px;
            flex-shrink: 0;
        }

        .h-icon-sys {
            background: #e2e8f0;
            color: #64748b;
        }

        .h-icon-user {
            background: #dbeafe;
            color: #1d4ed8;
        }

        .h-icon-api {
            background: #dcfce7;
            color: #15803d;
        }

        .h-icon-auto {
            background: #fff7ed;
            color: #c2410c;
        }

        .h-content {
            flex: 1;
        }

        .h-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 4px;
        }

        .h-action {
            font-weight: 800;
            font-size: 12px;
            text-transform: uppercase;
            color: #0f172a;
        }

        .h-time {
            font-family: monospace;
            font-size: 10px;
            color: #64748b;
        }

        .h-detail {
            font-size: 13px;
            color: #334155;
            line-height: 1.4;
        }

        /* MISC */
        .kpi-card {
            background: rgba(255, 255, 255, 0.85);
            padding: 18px;
            border-radius: 16px;
            border: 1px solid rgba(15, 23, 42, 0.08);
            display: flex;
            flex-direction: column;
            justify-content: center;
            position: relative;
            overflow: hidden;
            box-shadow: 0 18px 40px -30px rgba(15, 23, 42, 0.45);
        }

        .kpi-card::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 5px;
            background: linear-gradient(135deg, #ef4444, #b91c1c);
        }

        .kpi-value {
            font-size: 30px;
            font-weight: 900;
            color: #0f172a;
            letter-spacing: -0.02em;
        }

        #map-container {
            height: 100%;
            width: 100%;
            border-radius: 12px;
            z-index: 1;
            background: #0f172a;
        }

        .icon-btn {
            cursor: pointer;
            opacity: 0.6;
            transition: 0.2s;
            margin-left: 6px;
            font-size: 14px;
            position: relative;
            z-index: 5;
        }

        .icon-btn:hover {
            opacity: 1;
            transform: scale(1.2);
        }

        .copy-btn {
            color: #3b82f6;
        }

        .edit-icon {
            cursor: pointer;
            font-size: 10px;
            margin-left: 5px;
            color: #94a3b8;
            pointer-events: auto;
        }

        .edit-icon:hover {
            color: #C5A059;
        }

        .card-cb {
            position: absolute;
            top: 10px;
            left: 10px;
            z-index: 5;
        }

        /* Lowered from 50 to 5 */
        .modal-icon-link {
            display: block;
            width: 24px;
            height: 24px;
            border-radius: 4px;
            overflow: hidden;
            transition: transform 0.2s;
            background: white;
            padding: 2px;
            border: 1px solid #e2e8f0;
        }

        .modal-icon-link:hover {
            transform: scale(1.2);
            border-color: #C5A059;
        }

        .modal-icon-img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        /* DRIVER.JS */
        .driver-popover.driverjs-theme {
            background-color: #0f172a;
            color: #f1f5f9;
        }

        .driver-popover.driverjs-theme .driver-popover-title {
            color: #C5A059;
            font-weight: 800;
        }

        .driver-popover.driverjs-theme .driver-popover-description {
            color: #cbd5e1;
            font-size: 13px;
        }

        .driver-popover.driverjs-theme button {
            background-color: #C5A059;
            color: #0B1120;
            border: none;
            text-shadow: none;
            border-radius: 4px;
            font-weight: bold;
        }

        .driver-popover.driverjs-theme button:hover {
            background-color: #bfa575;
        }

        /* MODALS */
        .modal {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(11, 17, 32, 0.9);
            z-index: 100;
            backdrop-filter: blur(4px);
            justify-content: center;
            align-items: center;
            color: #334155;
        }

        .modal.active {
            display: flex;
        }

        .login-wrapper {
            position: fixed;
            inset: 0;
            background: #0f172a;
            z-index: 9999;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .login-box {
            background: white;
            padding: 40px;
            border-radius: 12px;
            width: 100%;
            max-width: 400px;
            text-align: center;
            color: #0f172a;
            border: 1px solid #C5A059;
        }

        .login-btn {
            width: 100%;
            padding: 12px;
            background: #0B1120;
            color: #C5A059;
            font-weight: bold;
            border-radius: 6px;
            cursor: pointer;
            margin-top: 10px;
        }

        /* MAP TOOLTIPS */
        .leaflet-tooltip {
            background: #0f172a !important;
            color: #C5A059 !important;
            border: 1px solid #C5A059 !important;
            font-weight: bold !important;
            font-family: 'Inter', sans-serif !important;
            font-size: 12px !important;
            border-radius: 4px !important;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
        }

        /* DUPLICATE MODAL */
        .dup-group {
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            margin-bottom: 8px;
            overflow: hidden;
        }

        .dup-header {
            background: #e2e8f0;
            padding: 6px 10px;
            font-size: 11px;
            font-weight: bold;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .dup-item {
            padding: 8px 10px;
            border-bottom: 1px solid #e2e8f0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 12px;
        }

        .dup-item:last-child {
            border-bottom: none;
        }

        .dup-master {
            background: #dcfce7;
            border-left: 4px solid #22c55e;
        }

        /* SEARCH VIEW */
        .search-section-header {
            font-size: 14px;
            font-weight: 800;
            color: #64748b;
            text-transform: uppercase;
            margin-bottom: 12px;
            border-bottom: 2px solid #e2e8f0;
            padding-bottom: 6px;
            margin-top: 24px;
        }

        .search-empty {
            text-align: center;
            color: #94a3b8;
            padding: 40px;
            font-style: italic;
        }

        /* Missing styles referenced by code (safe additions to prevent CSS warnings) */
        .status-badge {
            font-size: 9px;
            font-weight: 800;
            padding: 2px 6px;
            border-radius: 4px;
            text-transform: uppercase;
            background: #e2e8f0;
            color: #0f172a;
        }

        .tag-pill {
            font-size: 9px;
            font-weight: 800;
            padding: 2px 6px;
            border-radius: 999px;
            background: #e2e8f0;
            color: #0f172a;
        }

        .grid-copy-icon {
            font-size: 12px;
            opacity: 0.6;
            cursor: pointer;
        }

        .grid-copy-icon:hover {
            opacity: 1;
        }

        .due-badge {
            font-size: 9px;
            font-weight: 800;
            padding: 2px 6px;
            border-radius: 4px;
            background: #e2e8f0;
            color: #0f172a;
        }

        .due-overdue {
            background: #fee2e2;
            color: #991b1b;
        }

        .due-today {
            background: #fef3c7;
            color: #92400e;
        }

        .due-future {
            background: #dcfce7;
            color: #166534;
        }

        .paste-btn-icon {
            color: #64748b;
        }

        .paste-btn-icon:hover {
            color: #C5A059;
        }

        .modal-icon-row {
            display: flex;
            gap: 8px;
            align-items: center;
        }

        /* --- TOAST NOTIFICATION ENGINE (Fixed Position) --- */
        /* --- TOAST NOTIFICATION ENGINE (Bottom Right) --- */
        #toast-container {
            position: fixed;
            bottom: 24px;
            right: 24px;
            z-index: 10000;
            display: flex;
            flex-direction: column;
            gap: 10px;
            pointer-events: none;
        }

        .toast {
            background: #1e293b;
            color: white;
            padding: 12px 24px;
            border-radius: 8px;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
            border-left: 4px solid #C5A059;
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 13px;
            font-weight: 700;
            opacity: 0;
            transform: translateY(20px);
            transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
            pointer-events: auto;
            min-width: 250px;
        }

        .toast.show {
            opacity: 1;
            transform: translateY(0);
        }

        .toast-success {
            border-left-color: #22c55e;
        }

        .toast-error {
            border-left-color: #ef4444;
        }

        .toast-warning {
            border-left-color: #f59e0b;
        }
    </style>
        /* Icon-only header actions (UI-only; JS text remains for accessibility) */
        .icon-only-action {
            font-size: 0 !important;
            line-height: 0 !important;
            padding: 0 !important;
            width: 44px !important;
            height: 34px !important;
            min-width: 44px !important;
            display: inline-flex !important;
            align-items: center !important;
            justify-content: center !important;
            gap: 0 !important;
            white-space: nowrap !important;
            overflow: hidden !important;
            text-indent: -9999px !important;
            /* keeps text in DOM, hides visually */
            position: relative !important;
            border-radius: 12px !important;
        }

        .icon-only-action::before {
            content: "";
            display: block;
            width: 16px;
            height: 16px;
            background-repeat: no-repeat;
            background-size: 16px 16px;
            background-position: center;
            filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .25));
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
        }

        /* Tooltip (CSS-only) */
        .icon-only-action:hover::after {
            content: attr(title);
            position: absolute;
            top: calc(100% + 10px);
            left: 50%;
            transform: translateX(-50%);
            padding: 6px 10px;
            border-radius: 10px;
            font-size: 12px;
            line-height: 1;
            letter-spacing: .2px;
            color: rgba(255, 255, 255, .92);
            background: rgba(2, 6, 23, .92);
            border: 1px solid rgba(255, 255, 255, .12);
            box-shadow: 0 18px 30px rgba(0, 0, 0, .35);
            white-space: nowrap;
            z-index: 9999;
            text-indent: 0;
        }

        /* Specific icons (inline SVG) */
        #btnDeleteSelected.icon-only-action::before {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M9 3h6m-8 4h10m-9 0 1 16h6l1-16' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M10 11v7M14 11v7' stroke='%23fff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
        }

        #btnPromoteSelected.icon-only-action::before {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M12 3l2.8 5.7 6.2.9-4.5 4.4 1.1 6.2L12 17.9 6.4 20.2 7.5 14 3 9.6l6.2-.9L12 3z' stroke='%23fff' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E");
        }

        #btnMassEdit.icon-only-action::before {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M4 20h4l10.5-10.5a2.1 2.1 0 0 0 0-3L15.5 4a2.1 2.1 0 0 0-3 0L2 14.5V19a1 1 0 0 0 1 1z' stroke='%23fff' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M13.5 6.5l4 4' stroke='%23fff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
        }

        /* Keep focus visible */
        .icon-only-action:focus-visible {
            outline: none !important;
            box-shadow: 0 0 0 3px rgba(197, 160, 89, .35), 0 0 0 1px rgba(255, 255, 255, .12) inset !important;
        }
    </style>
