/* ==============================
   VAHAN ANALYTICS - PRODUCTION CSS
   ============================== */

:root {
    --bg: #070c18;
    --bg-card: rgba(13, 20, 40, 0.85);
    --bg-card-2: rgba(18, 28, 55, 0.6);
    --sidebar-bg: rgba(6, 10, 22, 0.95);
    --topbar-bg: rgba(7, 12, 24, 0.9);

    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.35);
    --accent-2: #8b5cf6;
    --accent-3: #06b6d4;
    --accent-4: #10b981;
    --accent-5: #f59e0b;
    --accent-6: #ef4444;

    --text-1: #f1f5f9;
    --text-2: #94a3b8;
    --text-3: #475569;
    --border: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.15);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 40px rgba(59, 130, 246, 0.15);

    --sidebar-w: 258px;
    --topbar-h: 72px;
    --radius: 14px;
    --radius-sm: 8px;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text-1);
    min-height: 100vh;
    overflow: hidden;
    background-image:
        radial-gradient(ellipse at 15% 20%, rgba(59, 130, 246, 0.07) 0, transparent 55%),
        radial-gradient(ellipse at 85% 80%, rgba(139, 92, 246, 0.07) 0, transparent 55%),
        radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.04) 0, transparent 60%);
}

/* ===== LAYOUT ===== */
.app-layout {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px;
    border-bottom: 1px solid var(--border);
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.brand-name {
    font-weight: 700;
    font-size: 15px;
    display: block;
}

.brand-sub {
    font-size: 10.5px;
    color: var(--text-3);
    display: block;
    margin-top: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
}

.nav-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0 8px;
    margin-bottom: 8px;
    display: block;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--bg-card-2);
    color: var(--text-1);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.15));
    color: var(--text-1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
}

.nav-item i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ===== SIDEBAR REPORT LIST ===== */
.sidebar-report-list {
    margin-top: 4px;
    border-top: 1px solid var(--border);
    padding-top: 4px;
}

.report-group-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px 4px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: default;
    user-select: none;
}

.report-group-label i {
    width: 12px;
    height: 12px;
    opacity: 0.6;
}

.report-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px 7px 20px;
    border-radius: 6px;
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 450;
    cursor: pointer;
    transition: all 0.18s ease;
    margin: 1px 4px;
    border: 1px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.report-item:hover {
    background: var(--bg-card-2);
    color: var(--text-1);
    border-color: rgba(255, 255, 255, 0.06);
}

.report-item.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(139, 92, 246, 0.12));
    color: var(--text-1);
    border-color: rgba(59, 130, 246, 0.3);
    font-weight: 550;
}

.report-item .ri-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text-3);
    flex-shrink: 0;
    transition: background 0.2s;
}

.report-item.active .ri-dot {
    background: var(--accent);
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.5);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.data-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 12px;
    color: var(--text-2);
}

.data-badge i {
    color: var(--accent);
    width: 16px;
}

.data-badge span {
    font-weight: 700;
    color: var(--accent);
    font-size: 14px;
    display: block;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100vh;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    height: var(--topbar-h);
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    flex-shrink: 0;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-sub {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 2px;
    display: block;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.report-select-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
}

.report-select-wrap i {
    color: var(--accent);
    width: 16px;
}

.report-select-wrap select {
    background: transparent;
    border: none;
    color: var(--text-1);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    outline: none;
    cursor: pointer;
    min-width: 220px;
}

.report-select-wrap select option {
    background: #0d1428;
}

.last-updated {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-3);
}

.last-updated i {
    width: 14px;
}

/* ===== PAGES ===== */
.pages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* ===== KPI GRID ===== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, border-color 0.3s;
}

.kpi-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-hover);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gradient-from, #3b82f6), var(--gradient-to, #8b5cf6));
}

.kpi-card.blue {
    --gradient-from: #3b82f6;
    --gradient-to: #6366f1;
}

.kpi-card.green {
    --gradient-from: #10b981;
    --gradient-to: #06b6d4;
}

.kpi-card.purple {
    --gradient-from: #8b5cf6;
    --gradient-to: #ec4899;
}

.kpi-card.amber {
    --gradient-from: #f59e0b;
    --gradient-to: #ef4444;
}

.kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.kpi-icon.blue {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.kpi-icon.green {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.kpi-icon.purple {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

.kpi-icon.amber {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.kpi-icon i {
    width: 20px;
    height: 20px;
}

.kpi-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
    margin-bottom: 6px;
}

.kpi-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-1);
}

.kpi-sub {
    font-size: 11.5px;
    color: var(--text-3);
    margin-top: 6px;
}

.kpi-change {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    margin-top: 8px;
}

.kpi-change.up {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.kpi-change.down {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Shimmer loading */
.kpi-card.loading {
    min-height: 160px;
}

.kpi-shimmer {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    height: 100%;
    width: 100%;
    border-radius: 8px;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* ===== CHART CARDS ===== */
.chart-row {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
}

.chart-row.two-col {
    grid-template-columns: 1fr 1fr;
}

.chart-row.one-col {
    grid-template-columns: 1fr;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    backdrop-filter: blur(10px);
    transition: border-color 0.3s;
}

.chart-card:hover {
    border-color: var(--border-hover);
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-card.no-pad {
    padding: 0;
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
}

.chart-card-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.chart-card-header p {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 3px;
}

.chart-area {
    position: relative;
    height: 280px;
}

.chart-area-tall {
    position: relative;
    height: 340px;
}

.chart-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ev-badge {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ===== PERIOD SELECTOR ===== */
.period-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
}

.period-pills {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.period-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    cursor: pointer;
    border: 1px solid var(--border);
    color: var(--text-3);
    background: transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
}

.period-pill:hover {
    border-color: var(--accent);
    color: var(--text-1);
}

.period-pill.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(139, 92, 246, 0.2));
    border-color: rgba(59, 130, 246, 0.5);
    color: var(--text-1);
}

.period-pill.cy {
    border-color: rgba(59, 130, 246, 0.3);
}

.period-pill.fy {
    border-color: rgba(245, 158, 11, 0.3);
}

.period-pill.cy.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(99, 102, 241, 0.2));
}

.period-pill.fy.active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(239, 68, 68, 0.15));
    border-color: rgba(245, 158, 11, 0.6);
    color: #fbbf24;
}

/* ===== CHART INSIGHT BOX ===== */
.chart-insight {
    margin-top: 14px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.025);
    border-left: 3px solid rgba(99, 102, 241, 0.45);
    border-radius: 0 6px 6px 0;
    font-size: 11.5px;
    color: var(--text-3);
    line-height: 1.55;
    display: flex;
    gap: 7px;
    align-items: flex-start;
}

.chart-insight::before {
    content: '💡';
    font-size: 12px;
    flex-shrink: 0;
    margin-top: 0px;
}

/* ===== HEATMAP ===== */
.heatmap-wrapper {
    overflow-x: auto;
    padding: 8px 0;
}

.heatmap-grid {
    display: grid;
    gap: 3px;
}

.heatmap-cell {
    width: 100%;
    height: 40px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.heatmap-cell:hover {
    transform: scale(1.1);
    opacity: 0.9;
    z-index: 10;
    position: relative;
}

.heatmap-row-label {
    font-size: 10.5px;
    color: var(--text-2);
    white-space: nowrap;
    padding-right: 8px;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.heatmap-col-label {
    font-size: 9.5px;
    color: var(--text-3);
    text-align: center;
    padding: 4px 2px;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-3);
}

.legend-gradient {
    width: 80px;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(16,185,129,0.1), #10b981, #065f46);
}

/* ===== PLACEHOLDERS ===== */
.explorer-placeholder,
.heatmap-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    gap: 12px;
    color: var(--text-3);
}

.placeholder-icon {
    width: 60px;
    height: 60px;
    opacity: 0.3;
}

.explorer-placeholder h2,
.heatmap-placeholder h2 {
    font-size: 20px;
    color: var(--text-2);
}

.explorer-placeholder p,
.heatmap-placeholder p {
    font-size: 14px;
}

/* ===== TABLE ===== */
.table-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.search-box {
    position: relative;
    width: 320px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    width: 16px;
}

.search-box input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px 10px 38px;
    color: var(--text-1);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--accent);
}

.table-meta {
    font-size: 12px;
    color: var(--text-3);
}

.table-scroll {
    overflow: auto;
    max-height: calc(100vh - 240px);
    border-radius: var(--radius);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    position: sticky;
    top: 0;
    background: rgba(13, 20, 40, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10;
    text-align: left;
    padding: 14px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transition: color 0.2s;
}

thead th:hover {
    color: var(--text-1);
}

tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 13px;
}

tbody tr:hover td {
    background: rgba(59, 130, 246, 0.05);
}

tbody tr:last-child td {
    border-bottom: none;
}

.empty-row {
    text-align: center;
    color: var(--text-3);
    padding: 60px !important;
}

/* ===== SCROLLBARS ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== COUNTER ANIMATION ===== */
.count-up {
    font-variant-numeric: tabular-nums;
}

@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-row.two-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ─── Analytics Page ───────────────────────────────────────────── */
.analytics-view {
    display: none;
}

.analytics-view.active {
    display: block;
}

.analytics-controls {
    margin-bottom: 16px;
}

.analytics-filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.analytics-pills {
    display: flex;
    gap: 6px;
}

.analytics-pill {
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.analytics-pill:hover {
    color: var(--text-1);
    border-color: rgba(255, 255, 255, 0.15);
}

.analytics-pill.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

/* Analytics table */
.analytics-table {
    width: 100%;
}

.analytics-table thead th {
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 2;
}

.growth-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.growth-badge.positive {
    color: #10b981;
    background: rgba(16, 185, 129, 0.12);
}

.growth-badge.negative {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
}

.rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-2);
}

.rank-num.top3 {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
}

/* ===== ONBOARDING / HELP BANNER ===== */
.page-guide {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(59, 130, 246, 0.07);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 18px;
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.6;
    transition: all 0.3s ease;
    overflow: hidden;
}

.page-guide-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
    line-height: 1;
}

.page-guide-body {
    flex: 1;
    min-width: 0;
}

.page-guide-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.page-guide-tips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.page-guide-tips li {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-2);
    font-size: 11.5px;
}

.page-guide-tips li::before {
    content: '→';
    color: var(--accent);
    font-weight: 700;
    font-size: 11px;
    flex-shrink: 0;
}

.page-guide-dismiss {
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: color 0.2s, background 0.2s;
    margin-top: -2px;
}

.page-guide-dismiss:hover {
    color: var(--text-1);
    background: rgba(255, 255, 255, 0.08);
}

.page-guide.hidden {
    display: none;
}

.page-guide-show-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-3);
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    transition: all 0.2s;
    margin-bottom: 14px;
}

.page-guide-show-btn:hover {
    color: var(--accent);
    border-color: rgba(59, 130, 246, 0.4);
}

/* ─── Multi-Select Entity Filter ─────────────────────────────────────────── */
.entity-filter-wrap {
    position: relative;
    display: inline-block;
    min-width: 220px;
    max-width: 360px;
}

.entity-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.entity-filter-btn:hover {
    border-color: rgba(255, 255, 255, 0.18);
    color: var(--text-1);
}

.entity-filter-btn .ef-icon {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    opacity: 0.5;
}

.entity-filter-btn .ef-count {
    margin-left: auto;
    padding: 1px 7px;
    font-size: 10px;
    font-weight: 600;
    background: var(--primary);
    color: #fff;
    border-radius: 10px;
    flex-shrink: 0;
}

.entity-filter-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 9999;
    width: 320px;
    max-height: 400px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    animation: efSlideIn 0.15s ease-out;
    backdrop-filter: blur(8px);
}

@keyframes efSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.entity-filter-dropdown.open {
    display: flex;
    flex-direction: column;
}

.ef-search-wrap {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
}

.ef-search {
    width: 100%;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--text-1);
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s;
}

.ef-search:focus {
    border-color: var(--primary);
}

.ef-actions {
    display: flex;
    gap: 6px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
}

.ef-action-btn {
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-3);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s;
}

.ef-action-btn:hover {
    color: var(--text-1);
    border-color: rgba(255, 255, 255, 0.15);
}

.ef-action-btn.primary {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.ef-action-btn.primary:hover {
    background: #2563eb;
}

.ef-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
    max-height: 280px;
}

.ef-list::-webkit-scrollbar {
    width: 5px;
}

.ef-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.ef-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    font-size: 12px;
    color: var(--text-2);
    cursor: pointer;
    transition: background 0.1s;
}

.ef-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.ef-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.ef-item-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ef-item-value {
    font-size: 11px;
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.ef-item.hidden {
    display: none;
}

.ef-empty {
    padding: 16px;
    text-align: center;
    font-size: 12px;
    color: var(--text-3);
}