/* ----------------------------------------------------
   💎 CityZen Analytics Pro - CSS Stylesheet
   Midnight Emerald Theme (Dark Luxury Glassmorphism)
   ---------------------------------------------------- */

/* --- CSS Root Custom Properties --- */
:root {
    --bg-primary: #040d0a;
    --bg-secondary: #071611;
    --bg-sidebar: #05100c;
    --card-bg: rgba(10, 28, 22, 0.45);
    --card-border: rgba(16, 185, 129, 0.15);
    --card-border-hover: rgba(16, 185, 129, 0.35);
    
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Accents */
    --accent-emerald: #10b981;
    --accent-emerald-glow: rgba(16, 185, 129, 0.3);
    
    --accent-gold: #f59e0b;
    --accent-gold-glow: rgba(245, 158, 11, 0.3);
    
    --accent-blue: #3b82f6;
    --accent-blue-glow: rgba(59, 130, 246, 0.3);
    
    --accent-purple: #8b5cf6;
    --accent-purple-glow: rgba(139, 92, 246, 0.3);
    
    --accent-teal: #14b8a6;
    --accent-teal-glow: rgba(20, 184, 166, 0.3);
    
    --accent-red: #ef4444;
    
    /* Fonts */
    --font-primary: 'Plus Jakarta Sans', 'Noto Sans Georgian', sans-serif;
    
    /* Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Basic Reset & Global Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-emerald);
}

/* --- Layout Structure --- */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* --- Sidebar --- */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    padding: 24px;
    flex-shrink: 0;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    margin-bottom: 40px;
}

.logo-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-glow {
    position: absolute;
    width: 45px;
    height: 45px;
    background: radial-gradient(circle, var(--accent-emerald) 0%, transparent 70%);
    opacity: 0.3;
    filter: blur(8px);
    left: -5px;
}

.logo-icon {
    font-size: 24px;
    z-index: 1;
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #fff;
    z-index: 1;
}

.logo-text span {
    color: var(--accent-emerald);
}

.sidebar-nav {
    flex-grow: 1;
}

.sidebar-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.nav-item i {
    width: 18px;
    height: 18px;
}

.nav-item:hover {
    color: #fff;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.1);
}

.nav-item.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 1px solid var(--accent-emerald);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.1);
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-top: 1px solid var(--card-border);
    padding-top: 20px;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online {
    background-color: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
}

.back-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.back-link:hover {
    color: var(--accent-emerald);
}

/* --- Main Content --- */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at 50% 0%, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    padding: 20px 32px 32px 32px;
    overflow-y: auto;
    height: 100vh;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.main-header h2 {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.main-header .subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.date-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.date-badge i {
    width: 16px;
    height: 16px;
    color: var(--accent-emerald);
}

.sync-notification-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.sync-notification-btn:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--accent-emerald);
    color: var(--accent-emerald);
    transform: rotate(45deg);
}

/* --- Viewport & Tab Panes --- */
.tab-viewport {
    flex-grow: 1;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.tab-pane.active {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Glassmorphic Panels & Cards --- */
.glass-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 24px;
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 20px;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.glass-card:hover {
    transform: translateY(-4px);
    border-color: var(--card-border-hover);
}

/* Glow highlights */
.glow-blue:hover { box-shadow: 0 0 25px rgba(59, 130, 246, 0.15); }
.glow-purple:hover { box-shadow: 0 0 25px rgba(139, 92, 246, 0.15); }
.glow-orange:hover { box-shadow: 0 0 25px rgba(245, 158, 11, 0.15); }
.glow-emerald:hover { box-shadow: 0 0 25px rgba(16, 185, 129, 0.15); }
.glow-gold:hover { box-shadow: 0 0 25px rgba(245, 158, 11, 0.2); }
.glow-teal:hover { box-shadow: 0 0 25px rgba(20, 184, 166, 0.15); }

/* --- Filters Toolbar --- */
.filters-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.filter-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.segmented-control {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    padding: 4px;
    border-radius: 12px;
}

.segment-btn {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.segment-btn.active {
    background: var(--accent-emerald);
    color: #fff;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.segmented-control.mini {
    padding: 3px;
    border-radius: 10px;
}

.segmented-control.mini .segment-btn {
    padding: 5px 12px;
    font-size: 11px;
}

.filter-inputs-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    gap: 12px;
}

.input-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-container.inline {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.input-container.inline label {
    margin-bottom: 0;
}

.input-container label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-container input,
.input-container select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    outline: none;
    transition: var(--transition-smooth);
    min-width: 140px;
}

.input-container input:focus,
.input-container select:focus {
    border-color: var(--accent-emerald);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

.primary-btn {
    background: linear-gradient(135deg, var(--accent-emerald) 0%, #0d9488 100%);
    border: none;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.primary-btn.mini {
    padding: 10px 14px;
    font-size: 12px;
}

.hidden {
    display: none !important;
}

/* --- KPI Grid --- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon.blue { background: rgba(59, 130, 246, 0.1); color: var(--accent-blue); }
.card-icon.purple { background: rgba(139, 92, 246, 0.1); color: var(--accent-purple); }
.card-icon.orange { background: rgba(245, 158, 11, 0.1); color: var(--accent-orange); }
.card-icon.emerald { background: rgba(16, 185, 129, 0.1); color: var(--accent-emerald); }
.card-icon.gold { background: rgba(245, 158, 11, 0.1); color: var(--accent-gold); }
.card-icon.teal { background: rgba(20, 184, 166, 0.1); color: var(--accent-teal); }

.kpi-value {
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 10px;
}

.kpi-breakdown {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.kpi-breakdown b {
    color: var(--text-primary);
}

.kpi-info-row {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 18px;
}

.progress-track {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar.blue { background-color: var(--accent-blue); }
.progress-bar.purple { background-color: var(--accent-purple); }
.progress-bar.orange { background-color: var(--accent-orange); }
.progress-bar.emerald { background-color: var(--accent-emerald); }
.progress-bar.gold { background-color: var(--accent-gold); }
.progress-bar.teal { background-color: var(--accent-teal); }

/* --- 2-Column Grids --- */
.grid-2-col {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 32px;
}

@media (max-width: 1024px) {
    .grid-2-col {
        grid-template-columns: 1fr;
    }
}

.panel-header {
    margin-bottom: 24px;
}

.panel-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-header h3 i {
    width: 20px;
    height: 20px;
    color: var(--accent-emerald);
}

.panel-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* --- Period Comparison --- */
.comparison-selectors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.comparison-results-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.comp-row {
    display: grid;
    grid-template-columns: 110px 1fr 100px 60px;
    align-items: center;
    gap: 12px;
}

.comp-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.comp-bar-container {
    height: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 2px;
}

.comp-bar-current {
    height: 5px;
    background-color: var(--accent-emerald);
    border-radius: 2px;
    transition: width 0.8s ease-out;
}

.comp-bar-base {
    height: 5px;
    background-color: var(--text-muted);
    border-radius: 2px;
    transition: width 0.8s ease-out;
}

.comp-numbers {
    font-size: 12px;
    text-align: right;
}

.comp-numbers .curr {
    color: var(--accent-emerald);
    font-weight: 700;
}

.comp-numbers .base {
    color: var(--text-secondary);
}

.comp-delta {
    font-size: 11px;
    font-weight: 700;
    text-align: right;
    border-radius: 4px;
    padding: 2px 4px;
}

.comp-delta.positive {
    color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.08);
}

.comp-delta.negative {
    color: var(--accent-red);
    background: rgba(239, 68, 68, 0.08);
}

/* --- Block Share --- */
.block-split-container {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 16px;
}

.chart-wrapper {
    position: relative;
}

.chart-wrapper.doughnut {
    width: 180px;
    height: 180px;
}

.blocks-legend {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.legend-label-col {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-val-col {
    font-weight: 700;
    color: #fff;
}

.no-data {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
}

/* --- Trends Chart Section --- */
.panel-header-with-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.actions-group {
    display: flex;
    gap: 16px;
    align-items: center;
}

.trends-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .trends-charts-grid {
        grid-template-columns: 1fr;
    }
}

.chart-box {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 16px;
}

.chart-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.chart-box-header h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-stat-badge {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
}

.chart-wrapper-large {
    height: 250px;
    position: relative;
}

/* --- Blocks Tab Total Summary --- */
.blocks-total-summary-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(13, 148, 136, 0.04) 100%);
    border: 1px solid var(--accent-emerald);
    border-radius: 18px;
    padding: 24px;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.1);
}

.summary-card-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
}

.summary-left-title h3 {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
}

.summary-left-title p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.summary-left-title b {
    color: var(--accent-emerald);
}

.summary-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 20px;
    flex-grow: 1;
    max-width: 70%;
}

@media(max-width:768px) {
    .summary-metrics-grid {
        max-width: 100%;
    }
}

.metric-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.metric-item .m-lbl {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.metric-item .m-val {
    font-size: 18px;
    font-weight: 800;
    color: var(--accent-emerald);
}

#blocks-total-val {
    color: var(--accent-gold);
}

.metric-item .m-sub {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: -4px;
}

/* --- Blocks Grid Tab --- */
.blocks-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 24px;
    min-height: 200px;
}

.block-stat-card {
    background-size: cover;
    background-position: center;
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 24px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
    
    /* 3D perspective setup */
    perspective: 1000px;
    transform-style: preserve-3d;
    will-change: transform, box-shadow;
    
    /* Smooth transitions for tilt release and border highlights */
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1),
                box-shadow 0.5s cubic-bezier(0.25, 0.8, 0.25, 1),
                border-color 0.3s ease;
}

/* Semi-translucent glass overlay - adjusted to let background images be much more visible and sharp */
.block-stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(3, 11, 8, 0.72) 0%, rgba(5, 16, 12, 0.65) 100%);
    backdrop-filter: blur(1.5px);
    -webkit-backdrop-filter: blur(1.5px);
    z-index: 0;
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.block-stat-card:hover::before {
    background: linear-gradient(135deg, rgba(3, 11, 8, 0.58) 0%, rgba(5, 16, 12, 0.50) 100%);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
}

/* Lift all content in 3D perspective layer space */
.block-stat-card > * {
    position: relative;
    z-index: 1;
    transform: translateZ(20px);
}

.block-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    transform: translateZ(30px);
}

.block-card-title {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 4px 16px rgba(0, 0, 0, 0.6);
}

.block-percent-badge {
    font-size: 11px;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.22);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
    padding: 3px 8px;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.progress-track {
    height: 7px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transform: translateZ(15px);
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    width: 0;
    transition: width 1.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.progress-bar.emerald {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
    position: relative;
    overflow: hidden;
}

/* Light shine effect pulsing through progress indicator */
.progress-bar.emerald::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.35) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: progress-gleam 2.5s infinite linear;
}

@keyframes progress-gleam {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Detailed Sold Amount Section */
.block-amount-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    transform: translateZ(35px);
}

.amount-lbl {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.block-amount-value {
    font-size: 26px;
    font-weight: 800;
    color: #fbbf24; /* warm luxury gold */
    letter-spacing: -0.5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 4px 16px rgba(0, 0, 0, 0.7);
}

/* Three-Way Apartment Breakdown Stats Box */
.block-stats-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 0;
    margin: 4px 0;
    transform: translateZ(28px);
}

.stat-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

.stat-icon {
    width: 14px;
    height: 14px;
    stroke-width: 2.5px;
    vertical-align: middle;
}

.stat-icon.icon-blue { color: var(--accent-blue, #3b82f6); }
.stat-icon.icon-emerald { color: var(--accent-emerald, #10b981); }
.stat-icon.icon-gold { color: var(--accent-gold, #fbbf24); }

.stat-value {
    font-size: 19px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

.stat-value.text-emerald {
    color: #34d399;
}

.stat-value.text-gold {
    color: #fbbf24;
}

.block-details-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    transform: translateZ(25px);
}

.block-details-grid div:nth-child(odd) {
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.block-details-grid div:nth-child(even) {
    font-weight: 700;
    color: #fff !important;
    text-align: right;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

/* --- Staggered Card Entrance Animation --- */
@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: translateY(35px) scale(0.96) rotateX(8deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0deg);
    }
}

.animate-card-entrance {
    opacity: 0;
    animation: cardEntrance 0.7s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

/* --- Zoho Live Embedded Charts --- */
.zoho-iframes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

@media(max-width:1024px) {
    .zoho-iframes-grid {
        grid-template-columns: 1fr;
    }
}

.iframe-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.iframe-card.full-width {
    grid-column: span 2;
}

@media(max-width:1024px) {
    .iframe-card.full-width {
        grid-column: span 1;
    }
}

.iframe-card h4 {
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.iframe-wrapper {
    width: 100%;
    height: 380px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    background-color: #fff;
}

.iframe-wrapper.large {
    height: 480px;
}

.iframe-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* --- Upload & Sync Tab --- */
.settings-group {
    margin-bottom: 40px;
}

.settings-group-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-primary);
}

.settings-group-title i,
.settings-group-title svg {
    color: var(--accent-emerald);
}

#admin-settings-group {
    margin-top: 45px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 30px;
}

#admin-settings-group .settings-group-title {
    color: var(--accent-gold);
}

#admin-settings-group .settings-group-title i,
#admin-settings-group .settings-group-title svg {
    color: var(--accent-gold);
}

.upload-sync-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
}

.sync-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 350px;
}

.card-header-icon-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.card-header-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-header-icon.green { background: rgba(16, 185, 129, 0.1); color: var(--accent-emerald); }
.card-header-icon.blue { background: rgba(59, 130, 246, 0.1); color: var(--accent-blue); }
.card-header-icon.gold { background: rgba(245, 158, 11, 0.1); color: var(--accent-gold); }

.sync-card h3 {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
}

.sync-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.file-drop-area {
    border: 2px dashed var(--card-border);
    border-radius: 12px;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.1);
    transition: var(--transition-smooth);
}

.file-drop-area:hover {
    border-color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.03);
}

.file-drop-area input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.file-drop-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
}

.file-name-display {
    font-size: 11px;
    color: var(--accent-emerald);
    font-weight: 600;
    word-break: break-all;
    text-align: center;
}

.action-status-msg {
    font-size: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    animation: fadeIn 0.3s ease-out;
}

.action-status-msg.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--accent-emerald);
    color: var(--accent-emerald);
}

.action-status-msg.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
}

.sync-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.sync-submit-btn {
    justify-content: center;
    padding: 14px;
}

.sync-status-display {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 16px;
    margin-top: 20px;
    animation: fadeIn 0.3s ease-out;
}

.status-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.status-badge {
    font-size: 11px;
    font-weight: 700;
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-gold);
    padding: 2px 6px;
    border-radius: 4px;
}

.status-badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
}

.status-message {
    font-size: 12px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.progress-bar-container {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill.animated {
    animation: loadingBar 2s infinite linear;
    background: linear-gradient(90deg, var(--accent-emerald) 0%, var(--accent-gold) 50%, var(--accent-emerald) 100%);
    background-size: 200% 100%;
}

@keyframes loadingBar {
    from { background-position: 0% 0%; }
    to { background-position: -200% 0%; }
}

/* --- Competitors Tab Map/KPI upgrades --- */
.competitor-bot-runner-panel {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(0,0,0,0) 100%);
}

#competitor-map {
    z-index: 1;
}

.competitor-info-selector-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.selected-competitor-meta-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.comp-title-h3 {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
}

.comp-caption {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    margin-bottom: 20px;
}

.comp-metrics-small-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.comp-kpi-sub-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.comp-kpi-sub-card .kpi-lbl {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.comp-kpi-sub-card .kpi-val {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
}

.kpi-val-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Price analysis cards 3 column grid */
.price-cards-3-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media(max-width:768px) {
    .price-cards-3-grid {
        grid-template-columns: 1fr;
    }
}

.price-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: center;
}

.price-card .pc-lbl {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.price-card .pc-val {
    font-size: 22px;
    font-weight: 800;
    color: var(--accent-gold);
}

.price-card.pc-green {
    border-color: rgba(16, 185, 129, 0.2);
    background: rgba(16, 185, 129, 0.02);
}
.price-card.pc-green .pc-val {
    color: var(--accent-emerald);
}

.price-card.pc-red {
    border-color: rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.02);
}
.price-card.pc-red .pc-val {
    color: var(--accent-red);
}

.scraper-action-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.scraper-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 18px;
}

.scraper-run-btn {
    width: 100%;
    justify-content: center;
}

.console-card {
    border-radius: 12px;
    border-color: #334155;
    background-color: #020617;
    overflow: hidden;
    padding: 0;
}

.console-header {
    background-color: #0f172a;
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1e293b;
}

.console-dots {
    display: flex;
    gap: 6px;
}

.console-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.red { background-color: #ef4444; }
.dot.yellow { background-color: #eab308; }
.dot.green { background-color: #22c55e; }

.console-title {
    font-size: 11px;
    font-family: monospace;
    color: #94a3b8;
}

.console-clear-btn {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.console-clear-btn:hover {
    color: #ef4444;
}

.console-body {
    padding: 16px;
    height: 180px;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.4;
    color: #22c55e;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.log-line {
    word-break: break-all;
}

.log-line.system {
    color: #38bdf8;
}

.log-line.error {
    color: #f87171;
}

.log-line.success {
    color: #4ade80;
    font-weight: 700;
}

/* --- Tables Styling --- */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: rgba(0, 0, 0, 0.2);
}

.table-container.large {
    max-height: 450px;
}

.premium-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.premium-table th {
    background-color: rgba(7, 22, 17, 0.8);
    padding: 14px 16px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--card-border);
}

.premium-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.premium-table tr:hover td {
    background-color: rgba(16, 185, 129, 0.03);
}

.table-loading, .table-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 30px !important;
}

.sales-list-filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 16px;
}

/* --- Loader Animation --- */
.loading-spinner-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 40px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(16, 185, 129, 0.1);
    border-top: 3px solid var(--accent-emerald);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Breakdown SVG Icons styling --- */
.kpi-breakdown span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.kpi-breakdown span i, .kpi-breakdown span svg {
    width: 12px;
    height: 12px;
    stroke-width: 2.5px;
    opacity: 0.8;
    vertical-align: middle;
}

#kpi-l1-breakdown span i, #kpi-l1-breakdown span svg { color: #3b82f6; }
#kpi-l2-breakdown span i, #kpi-l2-breakdown span svg { color: #a855f7; }
#kpi-l3-breakdown span i, #kpi-l3-breakdown span svg { color: #f97316; }
#kpi-l4-breakdown span i, #kpi-l4-breakdown span svg { color: #10b981; }

/* Interactive Sales Table Sort Styling */
.premium-table th:hover {
    background-color: rgba(16, 185, 129, 0.08) !important;
    color: #fff !important;
}
.premium-table th.active-sort {
    color: var(--accent-emerald) !important;
    border-bottom: 2px solid var(--accent-emerald) !important;
}
.premium-table th.active-sort .sort-icon {
    opacity: 1 !important;
    color: var(--accent-emerald) !important;
}

/* Custom Dropdown select and option styling */
select {
    background-color: #040d0a !important;
    color: #ffffff !important;
    border: 1px solid var(--card-border) !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    font-family: var(--font-primary) !important;
    font-size: 13px !important;
    outline: none !important;
    cursor: pointer !important;
    transition: var(--transition-smooth) !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'><path d='M1 1L5 5L9 1' stroke='%23ffffff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 10px 6px !important;
    padding-right: 32px !important;
}
select:focus {
    border-color: var(--accent-emerald) !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.15) !important;
}
option {
    background-color: #040d0a !important;
    color: #ffffff !important;
    font-family: var(--font-primary) !important;
    padding: 10px !important;
}
option:hover {
    background-color: var(--accent-emerald) !important;
    color: #ffffff !important;
}

/* Responsive Sidebar Navigation with Hamburger Menu */
@media (max-width: 768px) {
    #sidebar-toggle-btn {
        display: flex !important;
    }
    
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 9999;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        padding: 20px;
    }
}

/* Correction Page input fields styling */
.premium-table td input[type="number"],
.premium-table td input[type="text"] {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    width: 100%;
    font-family: var(--font-primary);
    font-size: 13px;
    outline: none;
    transition: var(--transition-smooth);
}
.premium-table td input[type="number"]:focus,
.premium-table td input[type="text"]:focus {
    border-color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.05);
}

/* Desktop Collapsed Sidebar States */
@media (min-width: 769px) {
    .sidebar.collapsed {
        width: 80px !important;
        padding: 24px 12px !important;
    }
    
    .sidebar.collapsed .logo-text,
    .sidebar.collapsed .nav-item span,
    .sidebar.collapsed .sidebar-footer .status-text,
    .sidebar.collapsed .sidebar-footer .back-link span {
        display: none !important;
    }
    
    .sidebar.collapsed .logo-container {
        justify-content: center;
    }
    
    .sidebar.collapsed .nav-item {
        justify-content: center;
        padding: 14px 10px;
        gap: 0;
    }
    
    .sidebar.collapsed .sidebar-footer {
        align-items: center;
        justify-content: center;
        gap: 20px;
    }
    
    .sidebar.collapsed .back-link {
        justify-content: center;
        padding: 10px;
    }
}

/* ====================================================
   👥 premium AUTHENTICATION & PROFILE LAYOUT STYLES
   ==================================================== */

/* Glassmorphic Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, rgba(7, 22, 17, 0.96) 0%, rgba(4, 13, 10, 0.99) 100%);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    z-index: 99999;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
    padding: 20px;
}

.login-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-card {
    max-width: 420px;
    width: 100%;
    padding: 40px;
    border-radius: 24px;
    background: rgba(10, 28, 22, 0.55);
    border: 1px solid rgba(16, 185, 129, 0.25);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(16, 185, 129, 0.08);
    position: relative;
    overflow: hidden;
    animation: loginSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.login-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.04) 0%, transparent 60%);
    pointer-events: none;
}

.login-logo {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 24px;
}

.login-logo h1 {
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.login-logo span {
    color: var(--accent-emerald);
}

.login-card h2 {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.login-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 28px;
    line-height: 1.5;
}

/* Shake Animation for Invalid Login */
.login-card.shake {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes loginSlideIn {
    from {
        opacity: 0;
        transform: translateY(-24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
    40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* Delete User Button */
.delete-user-btn {
    background: rgba(239, 68, 68, 0.08) !important;
    border: 1px solid rgba(239, 68, 68, 0.25) !important;
    color: var(--accent-red) !important;
    padding: 6px 12px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: var(--transition-smooth) !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.delete-user-btn:hover {
    background: var(--accent-red) !important;
    color: #ffffff !important;
    border-color: var(--accent-red) !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.35) !important;
}

/* Form status notifications */
.action-status-msg {
    margin-top: 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    padding: 10px 14px;
    transition: var(--transition-smooth);
}

/* --- 🧪 Premium Visual Funnel Pipelines --- */
.funnel-stage {
    position: relative;
    width: 100%;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 4px 0;
}

.funnel-stage-leads {
    clip-path: polygon(0% 0%, 100% 0%, 80% 100%, 20% 100%);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.2) 0%, rgba(37, 99, 235, 0.5) 100%);
    border-bottom: 1px solid rgba(59, 130, 246, 0.15);
}

.funnel-stage-leads:hover {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.4) 0%, rgba(37, 99, 235, 0.75) 100%);
    filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.45));
    transform: scale(1.015) translateY(-1px);
    z-index: 10;
}

.funnel-stage-contacts {
    clip-path: polygon(20% 0%, 80% 0%, 60% 100%, 40% 100%);
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.2) 0%, rgba(124, 58, 237, 0.5) 100%);
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
}

.funnel-stage-contacts:hover {
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.4) 0%, rgba(124, 58, 237, 0.75) 100%);
    filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.45));
    transform: scale(1.02) translateY(0px);
    z-index: 10;
}

.funnel-stage-sales {
    clip-path: polygon(40% 0%, 60% 0%, 50% 100%, 50% 100%);
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.5) 100%);
}

.funnel-stage-sales:hover {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.4) 0%, rgba(5, 150, 105, 0.75) 100%);
    filter: drop-shadow(0 0 12px rgba(16, 185, 129, 0.45));
    transform: scale(1.03) translateY(1px);
    z-index: 10;
}

.funnel-stage .funnel-title {
    font-size: 10px;
    font-weight: 700;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.funnel-stage span {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    line-height: 1.2;
}

/* --- 🔘 Premium Toggle Switch --- */
.switch-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    margin-bottom: 20px;
    transition: var(--transition-smooth);
}

.switch-container:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--card-border-hover);
}

.switch-label-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.switch-title {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
}

.switch-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.08);
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: #94a3b8;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: rgba(59, 130, 246, 0.2);
    border-color: var(--accent-blue);
}

input:checked + .slider:before {
    transform: translateX(22px);
    background-color: var(--accent-blue);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
}

/* --- 🤖 AI Chatbot Premium Widget Styles --- */
.floating-ai-chat-trigger {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-emerald) 0%, #064e3b 100%);
    border: 1px solid rgba(16, 185, 129, 0.4);
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-ai-chat-trigger.hidden {
    display: none !important;
}

.floating-ai-chat-trigger:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.5);
    border-color: var(--accent-emerald);
}

.floating-ai-chat-trigger i {
    width: 26px;
    height: 26px;
}

/* Pulse Ring Animation */
.floating-ai-chat-trigger .pulse-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--accent-emerald);
    animation: chatPulse 2s infinite;
    pointer-events: none;
    box-sizing: border-box;
}

@keyframes chatPulse {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    50% {
        opacity: 0.3;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* Chat Full-Screen Overlay */
.ai-chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 13, 10, 0.75);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.ai-chat-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.ai-chat-container {
    width: 90%;
    max-width: 950px;
    height: 85vh;
    background: rgba(10, 28, 22, 0.85);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(16, 185, 129, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ai-chat-overlay.active .ai-chat-container {
    transform: scale(1);
}

/* Header */
.ai-chat-header {
    padding: 18px 24px;
    background: rgba(7, 22, 17, 0.9);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-chat-header-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ai-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--accent-emerald);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.ai-avatar i {
    width: 22px;
    height: 22px;
    color: var(--accent-emerald);
}

.ai-chat-header-info h3 {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 2px 0;
}

.ai-chat-header-info .status-indicator {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.ai-chat-close-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.ai-chat-close-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
    transform: rotate(90deg);
}

.ai-chat-reset-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.ai-chat-reset-btn:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--accent-emerald);
    transform: rotate(-180deg);
}

/* Body */
.ai-chat-body {
    flex-grow: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Welcome Screen inside Chat */
.ai-chat-welcome {
    margin: auto;
    max-width: 550px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.ai-welcome-icon {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.15);
    animation: welcomeFloat 3s ease-in-out infinite;
}

@keyframes welcomeFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.ai-welcome-icon i {
    width: 36px;
    height: 36px;
    color: var(--accent-emerald);
}

.ai-chat-welcome h3 {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
}

.ai-chat-welcome p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 30px;
}

/* Suggestion Chips */
.ai-suggested-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.ai-suggestion-chip {
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.15);
    padding: 10px 16px;
    border-radius: 30px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border-style: solid;
    transition: var(--transition-smooth);
}

.ai-suggestion-chip:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--accent-emerald);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.ai-suggestion-chip i {
    width: 14px;
    height: 14px;
    color: var(--accent-emerald);
}

/* Message Bubbles */
.chat-msg-row {
    display: flex;
    width: 100%;
    margin-bottom: 4px;
}

.chat-msg-row.user {
    justify-content: flex-end;
}

.chat-msg-row.bot {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: 80%;
    padding: 14px 18px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.chat-msg-row.user .chat-bubble {
    background: linear-gradient(135deg, var(--accent-emerald) 0%, #065f46 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.chat-msg-row.bot .chat-bubble {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

/* Dynamic Charts inside Bubble */
.chat-chart-container {
    margin-top: 14px;
    background: rgba(7, 22, 17, 0.85);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 12px;
    padding: 16px;
    width: 100%;
    min-height: 250px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 4px 8px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-emerald);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
    opacity: 0.6;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* Footer Input Area */
.ai-chat-footer {
    padding: 20px 24px;
    background: rgba(7, 22, 17, 0.9);
    border-top: 1px solid var(--card-border);
}

.ai-chat-footer form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 8px 16px;
    transition: var(--transition-smooth);
}

.ai-chat-footer form:focus-within {
    border-color: var(--accent-emerald);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
    background: rgba(0, 0, 0, 0.45);
}

.ai-chat-footer textarea {
    flex-grow: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    resize: none;
    font-family: var(--font-primary);
    font-size: 14px;
    line-height: 1.4;
    max-height: 120px;
    padding: 8px 4px;
}

.ai-chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-emerald);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-bottom: 2px;
}

.ai-chat-send-btn:hover {
    background: #059669;
    transform: scale(1.05);
}

.ai-chat-send-btn i {
    width: 16px;
    height: 16px;
}

/* Table formatting for SQL summaries inside bubbles */
.ai-chat-table-wrapper {
    overflow-x: auto;
    margin: 12px 0;
    border-radius: 8px;
    border: 1px solid var(--card-border);
}

.ai-chat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    text-align: left;
}

.ai-chat-table th {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-emerald);
    font-weight: 700;
    padding: 8px 12px;
    border-bottom: 1px solid var(--card-border);
}

.ai-chat-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.ai-chat-table tr:last-child td {
    border-bottom: none;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .ai-chat-container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
        border: none;
    }
    .floating-ai-chat-trigger {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
}

/* Custom Date Picker Calendar Icon */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(53%) sepia(85%) saturate(478%) hue-rotate(113deg);
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.9;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    filter: invert(53%) sepia(85%) saturate(478%) hue-rotate(113deg);
    opacity: 1;
    transform: scale(1.15);
}

/* Sidebar Collapsed profile details wrapper */
.sidebar.collapsed .profile-details-wrapper {
    display: none !important;
}

/* Custom Multiselect styles */
.custom-multiselect-container {
    position: relative;
    min-width: 240px;
}

.custom-multiselect {
    position: relative;
    width: 100%;
    user-select: none;
}

.multiselect-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 38px;
    padding: 8px 14px;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.multiselect-trigger:hover {
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(30, 41, 59, 0.9);
}

.multiselect-trigger-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.multiselect-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 260px;
    z-index: 999;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    padding: 12px;
    max-height: 300px;
    overflow: hidden;
    flex-direction: column;
}

/* Prevent dropdown clipping in cards/panels when dropdown is active */
.glass-card.dropdown-active, .glass-panel.dropdown-active {
    overflow: visible !important;
    z-index: 1000 !important;
}

.custom-multiselect.active .multiselect-dropdown {
    display: flex !important;
}

.multiselect-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.multiselect-actions a {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

.multiselect-actions a:hover {
    color: #93c5fd;
}

.multiselect-options {
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 200px;
    padding-right: 4px;
}

/* Custom Scrollbar for multiselect dropdown */
.multiselect-options::-webkit-scrollbar {
    width: 6px;
}
.multiselect-options::-webkit-scrollbar-track {
    background: transparent;
}
.multiselect-options::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}
.multiselect-options::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.multiselect-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.multiselect-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.multiselect-option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 15px !important;
    height: 15px !important;
    min-width: 15px !important;
    max-width: 15px !important;
    padding: 0 !important;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 3px !important;
    background: transparent !important;
    display: inline-grid;
    place-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.multiselect-option input[type="checkbox"]:checked {
    background: var(--accent-blue) !important;
    border-color: var(--accent-blue) !important;
}

.multiselect-option input[type="checkbox"]:checked::before {
    content: "";
    width: 7px;
    height: 7px;
    transform: scale(1);
    background-color: white;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.multiselect-option span {
    font-size: 12px;
    color: #cbd5e1 !important;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
    flex-shrink: 1;
    min-width: 0;
}

.multiselect-option:hover span {
    color: #fff;
}

/* Mini variant for KPI Cards */
.custom-multiselect.mini {
    max-width: 100%;
}

.multiselect-trigger.mini {
    height: 28px;
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 6px;
    background: rgba(30, 41, 59, 0.4);
}

.custom-multiselect.mini .multiselect-dropdown {
    top: calc(100% + 4px);
    width: 220px;
    padding: 8px;
}

.custom-multiselect.mini .multiselect-options {
    max-height: 160px;
}

/* --- 🧬 Premium Indigo Theme & Generator Animations --- */
.glow-indigo:hover {
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.25);
}

.card-icon.indigo {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

/* Animated Generator/Engine Progress Bar */
.progress-bar.generator {
    background-image: repeating-linear-gradient(
        45deg,
        rgba(99, 102, 241, 0.85) 0px,
        rgba(99, 102, 241, 0.85) 8px,
        rgba(79, 70, 229, 0.95) 8px,
        rgba(79, 70, 229, 0.95) 16px
    );
    background-size: 32px 32px;
    animation: generator-crawl 1s linear infinite;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.6);
}

@keyframes generator-crawl {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 32px 0;
    }
}

/* Sci-fi breathing animation for generator KPI card */
@keyframes engine-pulse {
    0% {
        box-shadow: 0 0 12px rgba(99, 102, 241, 0.15), inset 0 0 12px rgba(99, 102, 241, 0.05);
        border-color: rgba(99, 102, 241, 0.25);
    }
    50% {
        box-shadow: 0 0 22px rgba(99, 102, 241, 0.45), inset 0 0 18px rgba(99, 102, 241, 0.15);
        border-color: rgba(99, 102, 241, 0.6);
    }
    100% {
        box-shadow: 0 0 12px rgba(99, 102, 241, 0.15), inset 0 0 12px rgba(99, 102, 241, 0.05);
        border-color: rgba(99, 102, 241, 0.25);
    }
}

.kpi-card.l2-conv {
    animation: engine-pulse 2.8s ease-in-out infinite;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

/* --- Light Mode Color Overrides --- */
:root[data-theme="light"] {
    --bg-primary: #f1f5f9;
    --bg-secondary: #f8fafc;
    --bg-sidebar: #ffffff;
    
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(16, 185, 129, 0.12);
    --card-border-hover: rgba(16, 185, 129, 0.3);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --accent-emerald-glow: rgba(16, 185, 129, 0.08);
    --accent-gold-glow: rgba(245, 158, 11, 0.08);
    --accent-blue-glow: rgba(59, 130, 246, 0.08);
    --accent-purple-glow: rgba(139, 92, 246, 0.08);
    --accent-teal-glow: rgba(20, 184, 166, 0.08);
}

/* Light mode adjustments for custom glass containers, overlays, and specific styles */
:root[data-theme="light"] .glass-panel,
:root[data-theme="light"] .glass-card,
:root[data-theme="light"] .kpi-card {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(16px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

:root[data-theme="light"] .date-badge {
    background: rgba(0, 0, 0, 0.05);
    color: #475569;
}

:root[data-theme="light"] .segmented-control {
    background: rgba(0, 0, 0, 0.05);
}

:root[data-theme="light"] .segmented-control button {
    color: #475569;
}

:root[data-theme="light"] .segmented-control button.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

:root[data-theme="light"] .modal-content,
:root[data-theme="light"] .settings-modal {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #0f172a;
}

:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
}

:root[data-theme="light"] input:focus,
:root[data-theme="light"] select:focus,
:root[data-theme="light"] textarea:focus {
    border-color: var(--accent-emerald) !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1) !important;
}

:root[data-theme="light"] .ai-chat-bubble.ai {
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.15);
    color: #0f172a;
}

:root[data-theme="light"] .ai-chat-bubble.user {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.15);
    color: #0f172a;
}

:root[data-theme="light"] .ai-chat-table th {
    background: rgba(16, 185, 129, 0.08);
    color: #047857;
}

:root[data-theme="light"] .ai-chat-table td {
    color: #1f2937;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

:root[data-theme="light"] .data-table th {
    background: rgba(16, 185, 129, 0.08);
    color: #0f172a;
}

:root[data-theme="light"] .data-table td {
    color: #1f2937;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

:root[data-theme="light"] .main-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.block-stat-card .stat-value,
:root[data-theme="light"] .block-stat-card .stat-value {
    color: #eff0f1 !important;
}

.block-stat-card .stat-label,
:root[data-theme="light"] .block-stat-card .stat-label {
    color: #ffffff !important;
}

:root[data-theme="light"] #nav-profile-username {
    color: #0f172a !important;
}

:root[data-theme="light"] .sidebar {
    border-right: 1px solid rgba(0, 0, 0, 0.08) !important;
}

:root[data-theme="light"] .logo-text {
    color: #0f172a !important;
}

:root[data-theme="light"] #nav-item-profile {
    border-bottom-color: rgba(0, 0, 0, 0.08) !important;
}

:root[data-theme="light"] #nav-profile-role {
    color: #475569 !important;
}

:root[data-theme="light"] .nav-item {
    color: #475569 !important;
}

:root[data-theme="light"] .nav-item i {
    color: #475569 !important;
}

:root[data-theme="light"] .nav-item:hover {
    color: var(--accent-emerald) !important;
    background: rgba(16, 185, 129, 0.06) !important;
}

:root[data-theme="light"] .nav-item:hover i {
    color: var(--accent-emerald) !important;
}

:root[data-theme="light"] .nav-item.active {
    color: var(--accent-emerald) !important;
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: var(--accent-emerald) !important;
}

:root[data-theme="light"] .nav-item.active i {
    color: var(--accent-emerald) !important;
}

:root[data-theme="light"] .sidebar-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
}

:root[data-theme="light"] .main-header h2 {
    color: #0f172a !important;
}

/* Custom Multiselect Light Mode overrides */
:root[data-theme="light"] .multiselect-trigger {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    color: #0f172a !important;
}

:root[data-theme="light"] .multiselect-trigger:hover {
    border-color: var(--accent-emerald) !important;
    background: #f8fafc !important;
}

:root[data-theme="light"] .multiselect-dropdown {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08) !important;
}

:root[data-theme="light"] .multiselect-actions {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

:root[data-theme="light"] .multiselect-actions a {
    color: var(--accent-emerald) !important;
}

:root[data-theme="light"] .multiselect-actions a:hover {
    color: var(--accent-emerald-glow) !important;
}

:root[data-theme="light"] .multiselect-option:hover {
    background: rgba(0, 0, 0, 0.04) !important;
}

:root[data-theme="light"] .multiselect-option input[type="checkbox"] {
    border: 1px solid rgba(0, 0, 0, 0.25) !important;
}

:root[data-theme="light"] .multiselect-option input[type="checkbox"]:checked {
    background: var(--accent-emerald) !important;
    border-color: var(--accent-emerald) !important;
}

:root[data-theme="light"] .multiselect-option span {
    color: #475569 !important;
}

:root[data-theme="light"] .multiselect-option:hover span {
    color: #0f172a !important;
}

:root[data-theme="light"] .multiselect-options::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15) !important;
}

:root[data-theme="light"] .multiselect-options::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3) !important;
}

/* Light Mode Typography Overrides (Fix white-on-white headings) */
:root[data-theme="light"] .main-content h1,
:root[data-theme="light"] .main-content h2,
:root[data-theme="light"] .main-content h3,
:root[data-theme="light"] .main-content h4,
:root[data-theme="light"] .main-content h5,
:root[data-theme="light"] .main-content h6,
:root[data-theme="light"] .panel-header h3,
:root[data-theme="light"] .block-card-title,
:root[data-theme="light"] .summary-left-title h3,
:root[data-theme="light"] .sync-card h3,
:root[data-theme="light"] .legend-val-col,
:root[data-theme="light"] .comp-title-h3,
:root[data-theme="light"] #user-form-header-title,
:root[data-theme="light"] .ai-chat-welcome h3,
:root[data-theme="light"] .ai-chat-header-info h3,
:root[data-theme="light"] .block-card-header h4,
:root[data-theme="light"] .card-inner h4,
:root[data-theme="light"] .panel-subtitle,
:root[data-theme="light"] .chart-box h4 {
    color: #0f172a !important;
    text-shadow: none !important;
}

:root[data-theme="light"] .kpi-value {
    color: #3e3838 !important;
}

:root[data-theme="light"] .panel-header h3 i,
:root[data-theme="light"] .card-inner h4 i,
:root[data-theme="light"] .settings-group-title i {
    color: var(--accent-emerald) !important;
}

/* Unified Chatbot Header/Dropdown/Footer background */
.ai-chat-header,
.ai-chat-dropdown-bar,
.ai-chat-footer {
    background: rgba(10, 28, 22, 0.85) !important;
}

/* Light Mode Unified Chatbot overrides */
:root[data-theme="light"] .ai-chat-container {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.12) !important;
}

:root[data-theme="light"] .ai-chat-header,
:root[data-theme="light"] .ai-chat-dropdown-bar,
:root[data-theme="light"] .ai-chat-footer {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

/* Light Mode conversions table overrides */
:root[data-theme="light"] .table-container {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

:root[data-theme="light"] .premium-table th {
    background-color: rgba(16, 185, 129, 0.06) !important;
    color: #0f172a !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

:root[data-theme="light"] .premium-table td {
    color: #334155 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

:root[data-theme="light"] .premium-table tr:hover td {
    background-color: rgba(16, 185, 129, 0.04) !important;
}

/* 📊 Pipeline Status Distribution Row Custom Styles */
.pipeline-row {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.pipeline-row:hover {
    transform: translateX(6px);
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(16, 185, 129, 0.18);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.pipeline-label {
    width: 260px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13.5px;
    font-family: 'Noto Sans Georgian', sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pipeline-progress-container {
    flex-grow: 1;
    margin: 0 30px;
    height: 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}
.pipeline-progress-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 1.2s cubic-bezier(0.1, 0.8, 0.2, 1);
}
.pipeline-count {
    width: 40px;
    text-align: right;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 14px;
}
.pipeline-pct {
    width: 50px;
    text-align: right;
    color: var(--text-secondary);
    font-size: 13px;
    margin-left: 16px;
    font-weight: 500;
}

/* Light Theme Overrides */
:root[data-theme="light"] .pipeline-row {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02) !important;
}
:root[data-theme="light"] .pipeline-row:hover {
    background: #ffffff !important;
    border-color: rgba(16, 185, 129, 0.25) !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05) !important;
}
:root[data-theme="light"] .pipeline-label {
    color: #0f172a !important;
}
:root[data-theme="light"] .pipeline-progress-container {
    background: rgba(0, 0, 0, 0.06) !important;
}
:root[data-theme="light"] .pipeline-count {
    color: #0f172a !important;
}
:root[data-theme="light"] .pipeline-pct {
    color: #64748b !important;
}

/* --- 🔆 Additional Light Theme Contrast & Legibility Overrides --- */

/* 1. Funnel Stages Contrast */
:root[data-theme="light"] .funnel-stage-leads {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.35) 100%) !important;
    border-bottom: 1px solid rgba(59, 130, 246, 0.3) !important;
}
:root[data-theme="light"] .funnel-stage-contacts {
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.15) 0%, rgba(124, 58, 237, 0.35) 100%) !important;
    border-bottom: 1px solid rgba(139, 92, 246, 0.3) !important;
}
:root[data-theme="light"] .funnel-stage-sales {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.35) 100%) !important;
}
:root[data-theme="light"] .funnel-stage .funnel-title {
    opacity: 1 !important;
    font-weight: 800 !important;
}
:root[data-theme="light"] .funnel-stage span {
    text-shadow: none !important;
}

/* 2. Competitors Tab Light Mode Styling */
:root[data-theme="light"] .selected-competitor-meta-box,
:root[data-theme="light"] .scraper-action-card,
:root[data-theme="light"] .competitor-bot-runner-panel,
:root[data-theme="light"] .competitor-info-selector-panel {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
}

:root[data-theme="light"] .comp-kpi-sub-card,
:root[data-theme="light"] .price-card {
    background: rgba(0, 0, 0, 0.03) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

:root[data-theme="light"] .comp-kpi-sub-card .kpi-val {
    color: #3e3838 !important;
}

:root[data-theme="light"] .comp-kpi-sub-card .kpi-lbl,
:root[data-theme="light"] .price-card .pc-lbl {
    color: #475569 !important;
}

:root[data-theme="light"] .comp-title-h3 {
    color: #0f172a !important;
}

:root[data-theme="light"] .comp-caption {
    color: #64748b !important;
}

/* 3. Sales Summary Card Light Mode Styling */
:root[data-theme="light"] .blocks-total-summary-card,
:root[data-theme="light"] #weekly-sales-summary-box {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-top: 4px solid var(--accent-purple) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04) !important;
}

:root[data-theme="light"] .summary-metrics-grid .metric-item {
    border-left-color: rgba(0, 0, 0, 0.08) !important;
}

:root[data-theme="light"] .summary-metrics-grid .m-val {
    color: #3e3838 !important;
}

/* 4. AI Chat Bubble & Chart Container Light Mode Styling */
:root[data-theme="light"] .chat-chart-container {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04) !important;
}

:root[data-theme="light"] .chat-msg-row.bot .chat-bubble {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    color: #0f172a !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
}

:root[data-theme="light"] .chat-msg-row.user .chat-bubble {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%) !important;
    color: #ffffff !important;
}

:root[data-theme="light"] .bubble-buttons-container button {
    border-color: rgba(0, 0, 0, 0.12) !important;
    color: #475569 !important;
}
:root[data-theme="light"] .bubble-buttons-container .ai-export-btn {
    background: rgba(16, 185, 129, 0.08) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: #059669 !important;
}
:root[data-theme="light"] .bubble-buttons-container .ai-share-btn {
    background: rgba(59, 130, 246, 0.08) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    color: #2563eb !important;
}

/* --- 🌟 Theme Switcher Onboarding Spotlight & Tooltip --- */
.theme-onboarding-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    z-index: 9998;
    transition: opacity 0.5s ease;
    pointer-events: auto;
}

.theme-onboarding-backdrop.fade-out,
.theme-onboarding-tooltip.fade-out {
    opacity: 0 !important;
    pointer-events: none !important;
}

.theme-spotlight-active {
    position: relative !important;
    z-index: 9999 !important;
    box-shadow: 0 0 0 4px var(--accent-emerald), 0 0 25px rgba(16, 185, 129, 0.9) !important;
    animation: themePulse 1.2s infinite ease-in-out !important;
}

@keyframes themePulse {
    0% {
        box-shadow: 0 0 0 0px rgba(16, 185, 129, 0.8), 0 0 10px rgba(16, 185, 129, 0.5);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0), 0 0 25px rgba(16, 185, 129, 0.9);
    }
    100% {
        box-shadow: 0 0 0 0px rgba(16, 185, 129, 0), 0 0 10px rgba(16, 185, 129, 0.5);
    }
}

.theme-onboarding-tooltip {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 10000;
    background: #0f172a;
    color: #ffffff;
    border: 1px solid var(--accent-emerald);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 12px;
    white-space: nowrap;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 0 0 15px rgba(16, 185, 129, 0.3);
    display: flex;
    align-items: center;
    gap: 6px;
    animation: bounceTooltip 0.8s ease-in-out infinite alternate;
    transition: opacity 0.5s ease;
    font-family: 'Noto Sans Georgian', sans-serif;
}

:root[data-theme="light"] .theme-onboarding-tooltip {
    background: #ffffff;
    color: #0f172a;
    border-color: var(--accent-emerald);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 0 15px rgba(16, 185, 129, 0.2);
}

.theme-onboarding-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 14px;
    width: 10px;
    height: 10px;
    background: inherit;
    border-left: 1px solid var(--accent-emerald);
    border-top: 1px solid var(--accent-emerald);
    transform: rotate(45deg);
}

@keyframes bounceTooltip {
    0% { transform: translateY(0); }
    100% { transform: translateY(5px); }
}

/* 5. Meta Ads Tab Charts & AI Chat Footer Form Light Mode Overrides */
:root[data-theme="light"] .trends-charts-grid .chart-box,
:root[data-theme="light"] .chart-box {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03) !important;
}

:root[data-theme="light"] .ai-chat-footer form {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
}

:root[data-theme="light"] .ai-chat-footer form:focus-within {
    background: #ffffff !important;
    border-color: var(--accent-emerald) !important;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2) !important;
}

:root[data-theme="light"] .ai-chat-footer textarea {
    color: #0f172a !important;
}

:root[data-theme="light"] .ai-chat-footer textarea::placeholder {
    color: #94a3b8 !important;
}

/* 6. Block Statistics Card Image Overlay & White Text Override (Both Themes) */
.block-stat-card,
.block-stat-card .block-card-title,
.block-stat-card .amount-lbl,
.block-stat-card .stat-label,
.block-stat-card .block-details-grid,
.block-stat-card .block-details-grid div {
    color: #ffffff !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9), 0 2px 8px rgba(0, 0, 0, 0.7) !important;
}

:root[data-theme="light"] .block-stat-card,
:root[data-theme="light"] .block-stat-card .block-card-title,
:root[data-theme="light"] .block-stat-card .amount-lbl,
:root[data-theme="light"] .block-stat-card .stat-label,
:root[data-theme="light"] .block-stat-card .block-details-grid,
:root[data-theme="light"] .block-stat-card .block-details-grid div {
    color: #ffffff !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9), 0 2px 8px rgba(0, 0, 0, 0.7) !important;
}

/* --- 🌟 Live Analytics Pipeline Flow Timeline & Distributed Card --- */
.live-flow-timeline-bar {
    position: relative;
    overflow: hidden;
}

.flow-timeline-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: relative;
    padding: 6px 0;
    flex-wrap: wrap;
}

.flow-step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 14px;
    flex: 1;
    min-width: 160px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.flow-step-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

:root[data-theme="light"] .flow-step-item {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}

:root[data-theme="light"] .flow-step-item:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08) !important;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.step-circle.blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.step-circle.orange {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.step-circle.purple {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.step-circle.emerald {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.step-circle.gold {
    background: rgba(251, 191, 36, 0.15);
    color: var(--accent-gold);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.step-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.step-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

:root[data-theme="light"] .step-title {
    color: #64748b !important;
}

.step-count {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
}

.flow-step-item.step-leads {
    min-width: 175px;
}

.step-sub-breakdown {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 3px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
}

.step-sub-breakdown .breakdown-item {
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.step-sub-breakdown .num-new {
    color: #38bdf8;
    font-weight: 800;
}

.step-sub-breakdown .num-upsert {
    color: #60a5fa;
    font-weight: 800;
}

:root[data-theme="light"] .step-sub-breakdown .num-new {
    color: #0284c7 !important;
}

:root[data-theme="light"] .step-sub-breakdown .num-upsert {
    color: #2563eb !important;
}

.flow-connector-line {
    flex-grow: 1;
    height: 3px;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.4) 0%, rgba(245, 158, 11, 0.4) 33%, rgba(139, 92, 246, 0.4) 66%, rgba(16, 185, 129, 0.4) 100%);
    position: relative;
    border-radius: 2px;
    min-width: 15px;
    overflow: hidden;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

.flow-pulse-dot {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.5) 50%, transparent 100%);
    animation: flowGlow 6s ease-in-out infinite alternate;
}

@keyframes flowGlow {
    0% { opacity: 0.2; transform: translateX(-60%); }
    50% { opacity: 0.7; }
    100% { opacity: 0.2; transform: translateX(60%); }
}

/* Card Glow & Color for Distributed Leads */
.kpi-card.l-dist {
    border-top: 3px solid #f59e0b;
}

.glow-orange {
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.1);
}

.glow-orange:hover {
    box-shadow: 0 8px 30px rgba(245, 158, 11, 0.25);
    border-color: rgba(245, 158, 11, 0.5);
}

.card-icon.orange {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.progress-bar.orange {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.flow-info-badge-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(59, 130, 246, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(59, 130, 246, 0.25);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-left: 6px;
}

.flow-info-badge-btn:hover {
    background: rgba(59, 130, 246, 0.25);
    color: #ffffff;
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
}

/* --- Competitor Radar Scanner Styles --- */
.radar-grid {
    position: absolute;
    width: 90%;
    height: 90%;
    border-radius: 50%;
    background: 
        radial-gradient(circle, transparent 30%, rgba(16, 185, 129, 0.03) 30%, transparent 31%,
                                 transparent 60%, rgba(16, 185, 129, 0.03) 60%, transparent 61%,
                                 transparent 90%, rgba(16, 185, 129, 0.03) 90%, transparent 91%);
    pointer-events: none;
}

@keyframes radar-sweep {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.radar-sweep {
    position: absolute;
    width: 95%;
    height: 95%;
    background: conic-gradient(from 0deg, rgba(16, 185, 129, 0.15) 0deg, rgba(16, 185, 129, 0) 90deg);
    border-radius: 50%;
    transform-origin: center;
    animation: radar-sweep 6s linear infinite;
    pointer-events: none;
}

.radar-ring {
    position: absolute;
    border: 1px solid rgba(16, 185, 129, 0.06);
    border-radius: 50%;
    pointer-events: none;
}
.ring-1 { width: 30%; height: 30%; }
.ring-2 { width: 60%; height: 60%; }
.ring-3 { width: 90%; height: 90%; }

.radar-crosshair-h {
    position: absolute;
    width: 90%;
    height: 1px;
    border-top: 1px dashed rgba(16, 185, 129, 0.08);
    pointer-events: none;
}
.radar-crosshair-v {
    position: absolute;
    height: 90%;
    width: 1px;
    border-left: 1px dashed rgba(16, 185, 129, 0.08);
    pointer-events: none;
}

@keyframes target-ping {
    0% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.4); opacity: 0.4; }
    100% { transform: scale(1); opacity: 0.9; }
}

.radar-target {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease-in-out;
}
.radar-target:hover {
    transform: translate(-50%, -50%) scale(1.15);
}

.radar-dot {
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    position: relative;
}
.radar-dot::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(16, 185, 129, 0.4);
    animation: target-ping 2s infinite ease-in-out;
    pointer-events: none;
}

.radar-dot.selected {
    background: #ef4444;
    box-shadow: 0 0 12px #ef4444;
}
.radar-dot.selected::after {
    border-color: rgba(239, 68, 68, 0.6);
}

.radar-label {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    background: rgba(16, 28, 22, 0.85);
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.radar-label.selected {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(30, 10, 10, 0.9);
}

.radar-sales {
    font-size: 9px;
    color: #34d399;
    font-weight: 800;
    margin-top: 1px;
}
.radar-sales.selected {
    color: #f87171;
}

/* Light Theme Radar Adjustments */
:root[data-theme="light"] #competitor-radar-container {
    background: radial-gradient(circle at center, rgba(16, 185, 129, 0.05) 0%, rgba(255, 255, 255, 0.9) 100%) !important;
}
:root[data-theme="light"] .radar-label {
    color: #1e293b;
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(16, 185, 129, 0.25);
    text-shadow: none;
}
:root[data-theme="light"] .radar-label.selected {
    background: rgba(254, 242, 242, 0.95);
    border-color: rgba(239, 68, 68, 0.3);
}




