/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --bg-tertiary: #242b3d;
    --bg-card: #1e2433;
    --text-primary: #ffffff;
    --text-secondary: #8b95a5;
    --text-muted: #5c6575;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;
    --accent-purple: #8b5cf6;
    --border-color: #2d3548;
    --sidebar-width: 260px;
    --header-height: 72px;
    --transition: all 0.2s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    display: flex;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-blue);
    color: var(--text-primary);
}

.nav-item svg {
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.property-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.property-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.property-name {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 0;
    min-height: 100vh;
}

/* ===== Header ===== */
.main-header {
    height: var(--header-height);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.date-range-picker {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 0.25rem;
}

.date-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
}

.date-btn:hover {
    color: var(--text-primary);
}

.date-btn.active {
    background: var(--accent-blue);
    color: var(--text-primary);
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--accent-green);
}

.pulse {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* ===== Dashboard Sections ===== */
.dashboard-section {
    display: none;
    padding: 2rem;
}

.dashboard-section.active {
    display: block;
}

/* ===== Metrics Grid ===== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metrics-grid.four-cols { grid-template-columns: repeat(4, 1fr); }
.metrics-grid.three-cols { grid-template-columns: repeat(3, 1fr); }

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: var(--transition);
}

.metric-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.metric-card.highlight {
    border-color: var(--accent-green);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), transparent);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.metric-change {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.metric-change.positive {
    color: var(--accent-green);
    background: rgba(16, 185, 129, 0.1);
}

.metric-change.negative {
    color: var(--accent-red);
    background: rgba(239, 68, 68, 0.1);
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.metric-sparkline {
    height: 40px;
    margin-top: 1rem;
}

/* ===== Charts ===== */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.chart-card.large {
    grid-column: span 1;
}

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

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-legend {
    display: flex;
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

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

.dot.blue { background: var(--accent-blue); }
.dot.green { background: var(--accent-green); }
.dot.red { background: var(--accent-red); }
.dot.yellow { background: var(--accent-yellow); }
.dot.purple { background: var(--accent-purple); }

.chart-container {
    position: relative;
    height: 280px;
}

/* ===== Tables ===== */
.tables-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

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

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.table-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.view-all {
    font-size: 0.875rem;
    color: var(--accent-blue);
    text-decoration: none;
}

.view-all:hover {
    text-decoration: underline;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.875rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table td {
    font-size: 0.875rem;
    color: var(--text-primary);
}

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

.data-table tr:hover td {
    background: var(--bg-tertiary);
}

/* ===== Real-time Section ===== */
.realtime-header {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-tertiary));
    border-radius: 16px;
    margin-bottom: 2rem;
}

.realtime-count .count-value {
    font-size: 5rem;
    font-weight: 700;
    color: var(--accent-green);
    line-height: 1;
}

.realtime-count .count-label {
    display: block;
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.realtime-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.realtime-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.realtime-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.realtime-list {
    list-style: none;
}

.realtime-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.realtime-list li:last-child {
    border-bottom: none;
}

.device-chart-container {
    height: 200px;
}

.realtime-timeline {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.realtime-timeline h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.timeline-chart {
    height: 120px;
}

/* ===== Conversion Funnel ===== */
.conversion-funnel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.conversion-funnel h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.funnel-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.funnel-step {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.funnel-bar {
    height: 40px;
    background: linear-gradient(90deg, var(--accent-blue), rgba(59, 130, 246, 0.5));
    border-radius: 4px;
    transition: var(--transition);
}

.funnel-step.highlight .funnel-bar {
    background: linear-gradient(90deg, var(--accent-green), rgba(16, 185, 129, 0.5));
}

.funnel-info {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.funnel-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.funnel-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== Clarity Section ===== */
.clarity-header {
    text-align: center;
    padding: 2rem;
    margin-bottom: 2rem;
}

.clarity-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.clarity-header p {
    color: var(--text-secondary);
}

.clarity-metrics {
    margin-bottom: 2rem;
}

.clarity-insights {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.insight-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.insight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.insight-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.external-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--accent-blue);
    text-decoration: none;
}

.external-link:hover {
    text-decoration: underline;
}

.recordings-preview {
    display: flex;
    gap: 1rem;
}

.recording-item {
    flex: 1;
    background: var(--bg-tertiary);
    border-radius: 8px;
    overflow: hidden;
}

.recording-thumbnail {
    height: 80px;
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
}

.recording-info {
    padding: 0.75rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.heatmap-types {
    display: flex;
    gap: 1rem;
}

.heatmap-type {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.heatmap-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
}

.heatmap-icon.click {
    background: linear-gradient(135deg, #ef4444, #f59e0b, #10b981);
}

.heatmap-icon.scroll {
    background: linear-gradient(180deg, #3b82f6, transparent);
}

.heatmap-icon.area {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
}

.clarity-behavior {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.behavior-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.behavior-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.frustration-chart {
    height: 200px;
}

.click-areas {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.click-area-item {
    display: grid;
    grid-template-columns: 140px 1fr 50px;
    align-items: center;
    gap: 1rem;
}

.area-name {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.area-bar {
    height: 8px;
    background: var(--accent-blue);
    border-radius: 4px;
}

.area-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    text-align: right;
}

.clarity-embed {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
}

.clarity-embed h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.embed-note {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.clarity-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
}

.clarity-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
}

/* ===== Clarity Iframe ===== */
.clarity-iframe-container {
    width: 100%;
    height: 600px;
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

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

.clarity-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.clarity-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.clarity-link-btn:hover {
    background: var(--bg-card);
    border-color: var(--accent-blue);
}

.clarity-link-btn.primary {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border-color: transparent;
    color: white;
}

.clarity-link-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
}

/* ===== GA Embed Section ===== */
.ga-embed-header {
    text-align: center;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.ga-embed-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.ga-embed-header p {
    color: var(--text-secondary);
}

.ga-embed-container {
    width: 100%;
    height: 700px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

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

.ga-links {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.ga-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.ga-link-btn.primary {
    background: linear-gradient(135deg, #4285f4, #34a853);
    border-color: transparent;
    color: white;
}

.ga-link-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(66, 133, 244, 0.3);
}

/* ===== Data Status Indicator ===== */
.data-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.data-status.live {
    color: var(--accent-green);
}

.data-status.demo {
    color: var(--accent-yellow);
}

/* ===== New Clarity Integration Styles ===== */

/* Clarity Tabs */
.clarity-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.clarity-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.clarity-tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.clarity-tab.active {
    background: var(--accent-purple);
    color: white;
}

.clarity-tab svg {
    flex-shrink: 0;
}

/* Clarity Tab Content */
.clarity-tab-content {
    display: none;
}

.clarity-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Clarity Metrics */
.clarity-metric {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.clarity-metric .metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.clarity-metric .metric-icon.sessions {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

.clarity-metric .metric-icon.duration {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.clarity-metric .metric-icon.pages {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-yellow);
}

.clarity-metric .metric-icon.engagement {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.clarity-metric .metric-content {
    display: flex;
    flex-direction: column;
}

.clarity-metric.highlight-green {
    border-color: var(--accent-green);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), var(--bg-card));
}

/* Clarity Section Header */
.clarity-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 2rem 0 1rem;
}

.clarity-section-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.clarity-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.clarity-badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-yellow);
}

/* Frustration Grid */
.frustration-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.frustration-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    transition: var(--transition);
}

.frustration-card:hover {
    border-color: var(--accent-red);
    transform: translateY(-2px);
}

.frustration-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.frustration-card.dead-clicks .frustration-icon {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.frustration-card.rage-clicks .frustration-icon {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-yellow);
}

.frustration-card.quick-backs .frustration-icon {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

.frustration-card.excessive-scroll .frustration-icon {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
}

.frustration-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.frustration-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.frustration-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.frustration-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Scroll Depth Visual */
.scroll-depth-visual {
    padding: 1rem 0;
}

.scroll-bar-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.scroll-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    position: relative;
    overflow: hidden;
}

.scroll-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    border-radius: 8px;
    transition: width 0.5s ease;
}

.scroll-bar[data-depth="25"] .scroll-fill { background: linear-gradient(90deg, rgba(16, 185, 129, 0.3), rgba(16, 185, 129, 0.1)); }
.scroll-bar[data-depth="50"] .scroll-fill { background: linear-gradient(90deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.1)); }
.scroll-bar[data-depth="75"] .scroll-fill { background: linear-gradient(90deg, rgba(132, 204, 22, 0.3), rgba(132, 204, 22, 0.1)); }
.scroll-bar[data-depth="90"] .scroll-fill { background: linear-gradient(90deg, rgba(234, 179, 8, 0.3), rgba(234, 179, 8, 0.1)); }
.scroll-bar[data-depth="100"] .scroll-fill { background: linear-gradient(90deg, rgba(245, 158, 11, 0.3), rgba(245, 158, 11, 0.1)); }

.scroll-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    z-index: 1;
    min-width: 50px;
}

.scroll-count {
    margin-left: auto;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    z-index: 1;
}

/* Interactions List */
.interactions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.interaction-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    transition: var(--transition);
}

.interaction-item:hover {
    background: var(--bg-secondary);
}

.interaction-name {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.interaction-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.interaction-count {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.interaction-percentage {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
    border-radius: 4px;
}

/* Chart Subtitle */
.chart-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: auto;
}

/* Full Width Chart */
.chart-card.full-width {
    grid-column: 1 / -1;
}

/* Clarity Embed Header */
.clarity-embed-header {
    text-align: center;
    padding: 1.5rem;
}

.clarity-embed-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.clarity-embed-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Full Clarity Embed */
.clarity-full-embed {
    width: 100%;
    height: calc(100vh - 280px);
    min-height: 600px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

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

/* ===== Light Theme ===== */
body.light-theme {
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eef1f5;
    --bg-card: #ffffff;
    --text-primary: #1a1f2e;
    --text-secondary: #5c6575;
    --text-muted: #8b95a5;
    --border-color: #e2e8f0;
}

body.light-theme .sidebar {
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

body.light-theme .metric-card,
body.light-theme .chart-card,
body.light-theme .table-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* ===== Header Actions ===== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
}

.header-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--accent-blue);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: var(--accent-red);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    opacity: 0;
    transform: scale(0.8);
    transition: var(--transition);
}

.notification-badge.visible {
    opacity: 1;
    transform: scale(1);
}

.theme-toggle .moon-icon {
    display: none;
}

body.light-theme .theme-toggle .sun-icon {
    display: none;
}

body.light-theme .theme-toggle .moon-icon {
    display: block;
}

/* ===== Notification Panel ===== */
.notification-panel {
    position: fixed;
    top: var(--header-height);
    right: -400px;
    width: 380px;
    max-height: calc(100vh - var(--header-height));
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0 0 0 12px;
    box-shadow: -4px 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 200;
    transition: right 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notification-panel.open {
    right: 0;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.notification-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.clear-notifications {
    background: none;
    border: none;
    color: var(--accent-blue);
    font-size: 0.875rem;
    cursor: pointer;
}

.clear-notifications:hover {
    text-decoration: underline;
}

.notification-list {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
}

.notification-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.notification-item:hover {
    background: var(--bg-tertiary);
}

.notification-item.unread {
    background: rgba(59, 130, 246, 0.05);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon.hot-lead {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.notification-icon.form-submit {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.notification-icon.company {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.notification-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.notification-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.notification-empty {
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
}

/* ===== Export Modal ===== */
.export-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.export-modal.open {
    opacity: 1;
    visibility: visible;
}

.export-modal-content {
    width: 90%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.export-modal.open .export-modal-content {
    transform: translateY(0);
}

.export-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.export-modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close-modal {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.close-modal:hover {
    background: var(--accent-red);
    color: white;
}

.export-options {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.export-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.export-option:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-blue);
}

.export-option svg {
    color: var(--accent-blue);
}

/* ===== Visitor Intent Section ===== */
.intent-header {
    margin-bottom: 2rem;
}

.intent-summary h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.intent-summary p {
    color: var(--text-secondary);
}

/* Intent Metrics */
.intent-metric {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.intent-metric .metric-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.intent-metric .metric-icon.fire {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(249, 115, 22, 0.15));
    color: var(--accent-red);
}

.intent-metric .metric-icon.contact {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.intent-metric .metric-icon.cta {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.intent-metric .metric-icon.lot {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-yellow);
}

.intent-metric .metric-content {
    display: flex;
    flex-direction: column;
}

.intent-metric .metric-subtext {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.intent-metric.high-intent {
    border-color: var(--accent-red);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), var(--bg-card));
}

.intent-metric.highlight-gold {
    border-color: var(--accent-yellow);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), var(--bg-card));
}

/* Intent Section Header */
.intent-section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0 1rem;
}

.intent-section-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.intent-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.intent-badge.hot {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(249, 115, 22, 0.15));
    color: var(--accent-red);
}

.intent-badge.info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

/* Hot Leads Table */
.hot-leads-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.hot-leads-table .intent-score {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.intent-score-bar {
    width: 60px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.intent-score-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.intent-score-fill.high { background: linear-gradient(90deg, #ef4444, #f97316); }
.intent-score-fill.medium { background: linear-gradient(90deg, #f59e0b, #eab308); }
.intent-score-fill.low { background: linear-gradient(90deg, #10b981, #22c55e); }

/* Visitor Journey Funnel */
.journey-funnel {
    padding: 1rem 0;
}

.journey-stage {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.stage-bar-wrapper {
    flex: 1;
    margin-right: 1rem;
}

.stage-bar {
    height: 40px;
    border-radius: 6px;
    transition: width 0.6s ease;
    position: relative;
    overflow: hidden;
}

.stage-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1));
}

.stage-1 { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.stage-2 { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.stage-3 { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stage-4 { background: linear-gradient(90deg, #f97316, #fb923c); }
.stage-5 { background: linear-gradient(90deg, #10b981, #34d399); }

.stage-info {
    min-width: 180px;
    display: flex;
    flex-direction: column;
}

.stage-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.stage-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stage-percentage {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Intent Signals Grid */
.intent-signals-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.signal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.signal-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.signal-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.signal-icon.multi-page {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.signal-icon.long-session {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

.signal-icon.contact-view {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.signal-icon.form-start {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-yellow);
}

.signal-info {
    display: flex;
    flex-direction: column;
}

.signal-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.signal-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.signal-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ===== Animations ===== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.metric-card,
.chart-card,
.table-card,
.signal-card {
    animation: fadeInUp 0.4s ease forwards;
}

.metrics-grid > *:nth-child(1) { animation-delay: 0.05s; }
.metrics-grid > *:nth-child(2) { animation-delay: 0.1s; }
.metrics-grid > *:nth-child(3) { animation-delay: 0.15s; }
.metrics-grid > *:nth-child(4) { animation-delay: 0.2s; }

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 1.5s infinite;
}

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

/* Smooth value transitions */
.metric-value {
    transition: color 0.3s ease;
}

/* ===== Responsive ===== */
@media (max-width: 1400px) {
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-row { grid-template-columns: 1fr; }
    .realtime-grid { grid-template-columns: repeat(2, 1fr); }
    .frustration-grid { grid-template-columns: repeat(2, 1fr); }
    .intent-signals-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .main-content { margin-left: 0; }
    .tables-row { grid-template-columns: 1fr; }
    .clarity-insights { grid-template-columns: 1fr; }
    .clarity-behavior { grid-template-columns: 1fr; }
    .clarity-tabs { flex-wrap: wrap; }
    .notification-panel { width: 100%; right: -100%; }
}

@media (max-width: 768px) {
    .metrics-grid { grid-template-columns: 1fr; }
    .realtime-grid { grid-template-columns: 1fr; }
    .frustration-grid { grid-template-columns: 1fr; }
    .intent-signals-grid { grid-template-columns: 1fr; }
    .main-header { flex-direction: column; gap: 1rem; padding: 1rem; }
    .header-left, .header-right { width: 100%; }
    .header-right { flex-wrap: wrap; justify-content: center; }
    .date-range-picker { width: 100%; justify-content: center; }
    .clarity-tab { padding: 0.75rem 1rem; font-size: 0.75rem; }
    .clarity-tab span { display: none; }
    .stage-info { min-width: 120px; }
    .hot-leads-table { font-size: 0.75rem; }
}

/* ===== Visitors Intelligence Section ===== */

/* Visitors Header */
.visitors-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.visitors-summary h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.visitors-summary p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.visitors-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--accent-blue);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

/* Alert Banner */
.alert-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(249, 115, 22, 0.1));
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    animation: alertPulse 2s ease-in-out infinite;
}

@keyframes alertPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 0 20px 0 rgba(239, 68, 68, 0.2); }
}

.alert-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-red);
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    color: var(--accent-red);
    display: block;
    margin-bottom: 0.25rem;
}

.alert-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.alert-dismiss {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

.alert-dismiss:hover {
    color: var(--text-primary);
}

/* Visitor Stats Grid */
.visitor-stats {
    margin-bottom: 2rem;
}

.visitor-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.visitor-stat .metric-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.visitors-icon {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.hot-icon {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(249, 115, 22, 0.15));
    color: var(--accent-red);
}

.companies-icon {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

.returning-icon {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.hot-stat {
    border-color: var(--accent-red);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), var(--bg-card));
}

.returning-stat {
    border-color: var(--accent-green);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), var(--bg-card));
}

/* Pipeline Section */
.pipeline-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.pipeline-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.pipeline-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pipeline-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

.pipeline-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.pipeline-stage {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: var(--transition);
    border: 1px solid transparent;
}

.pipeline-stage:hover {
    transform: translateY(-2px);
    border-color: var(--border-color);
}

.stage-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.stage-icon {
    font-size: 1.25rem;
}

.stage-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.stage-count {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.stage-bar {
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.stage-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.stage-fill.hot { background: linear-gradient(90deg, #ef4444, #f97316); }
.stage-fill.warm { background: linear-gradient(90deg, #f59e0b, #eab308); }
.stage-fill.cold { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.stage-fill.browsing { background: linear-gradient(90deg, #6b7280, #9ca3af); }

.stage-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.hot-stage:hover { border-color: var(--accent-red); }
.warm-stage:hover { border-color: var(--accent-yellow); }
.cold-stage:hover { border-color: var(--accent-blue); }

/* Visitors Content Layout */
.visitors-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

/* Visitor List Section */
.visitor-list-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.list-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.list-filters {
    display: flex;
    gap: 0.75rem;
}

.filter-select {
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.8125rem;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.visitor-table-container {
    overflow-x: auto;
}

.visitor-table {
    width: 100%;
}

.visitor-table th {
    background: var(--bg-tertiary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.visitor-table td {
    vertical-align: middle;
}

.visitor-score {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.875rem;
}

.score-badge.hot { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.score-badge.warm { background: rgba(245, 158, 11, 0.15); color: var(--accent-yellow); }
.score-badge.cold { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.score-badge.low { background: rgba(107, 114, 128, 0.15); color: var(--text-muted); }

.visitor-info {
    display: flex;
    flex-direction: column;
}

.visitor-fingerprint {
    font-size: 0.8125rem;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

.visitor-device {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.company-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.company-badge.enterprise {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(99, 102, 241, 0.2));
}

.location-info {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
}

.dfw-indicator {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
}

.session-count {
    font-weight: 600;
    color: var(--text-primary);
}

.last-seen {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.action-btn {
    padding: 0.375rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.list-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: var(--transition);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--accent-blue);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Company Cards Section */
.company-cards-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    max-height: 600px;
    overflow-y: auto;
}

.cards-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.cards-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.company-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.company-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    transition: var(--transition);
}

.company-card:hover {
    border-color: var(--accent-purple);
    transform: translateX(4px);
}

.company-card.enterprise {
    border-color: rgba(139, 92, 246, 0.3);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), var(--bg-tertiary));
}

.company-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.company-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.company-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.company-industry {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.company-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.company-stat {
    display: flex;
    flex-direction: column;
}

.company-stat-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.company-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.company-location {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.linkedin-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: #0077b5;
    color: white;
    border-radius: 4px;
    font-size: 0.7rem;
    text-decoration: none;
    margin-top: 0.75rem;
    transition: var(--transition);
}

.linkedin-btn:hover {
    background: #005885;
}

/* Visitor Modal */
.visitor-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 2rem;
}

.visitor-modal.open {
    opacity: 1;
    visibility: visible;
}

.visitor-modal-content {
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.visitor-modal.open .visitor-modal-content {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-title h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.visitor-id-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    color: var(--text-muted);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.modal-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.modal-section h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

/* Visitor Overview in Modal */
.visitor-overview {
    display: flex;
    gap: 2rem;
}

.overview-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: conic-gradient(
        var(--accent-blue) calc(var(--score, 0) * 3.6deg),
        var(--bg-tertiary) 0deg
    );
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    inset: 8px;
    background: var(--bg-card);
    border-radius: 50%;
}

.score-circle .score-value,
.score-circle .score-label {
    position: relative;
    z-index: 1;
}

.score-circle .score-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.score-circle .score-label {
    font-size: 0.625rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.score-grade {
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    background: var(--accent-blue);
    color: white;
}

.score-grade.hot { background: var(--accent-red); }
.score-grade.warm { background: var(--accent-yellow); color: #000; }

.overview-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.detail-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.status-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.status-badge.new { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.status-badge.contacted { background: rgba(245, 158, 11, 0.15); color: var(--accent-yellow); }
.status-badge.qualified { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.status-badge.converted { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.status-badge.lost { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }

/* Info Grid in Modal */
.visitor-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.info-card {
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 1rem;
}

.info-card h4 {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.info-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    color: var(--text-primary);
    font-weight: 500;
}

.info-icon {
    font-size: 1.25rem;
}

.info-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.info-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
}

.linkedin-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.5rem;
    color: #0077b5;
    text-decoration: none;
    font-size: 0.75rem;
}

.linkedin-link:hover {
    text-decoration: underline;
}

/* Signals Grid in Modal */
.signals-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.signal-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.signal-tag.engagement { border: 1px solid var(--accent-green); color: var(--accent-green); }
.signal-tag.intent { border: 1px solid var(--accent-yellow); color: var(--accent-yellow); }
.signal-tag.location { border: 1px solid var(--accent-blue); color: var(--accent-blue); }
.signal-tag.company { border: 1px solid var(--accent-purple); color: var(--accent-purple); }
.signal-tag.conversion { border: 1px solid var(--accent-red); color: var(--accent-red); }

/* Journey Timeline in Modal */
.journey-timeline {
    position: relative;
    padding-left: 1.5rem;
}

.journey-timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.journey-item {
    position: relative;
    padding-bottom: 1rem;
    padding-left: 1rem;
}

.journey-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-blue);
    border: 2px solid var(--bg-card);
}

.journey-item.event::before { background: var(--accent-green); }
.journey-item.cta::before { background: var(--accent-yellow); }
.journey-item.form::before { background: var(--accent-purple); }

.journey-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.25rem;
}

.journey-action {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.journey-detail {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Notes Section in Modal */
.notes-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.notes-input {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    resize: vertical;
    font-family: inherit;
}

.notes-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* Modal Footer */
.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-select {
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.8125rem;
    cursor: pointer;
}

.status-select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* Empty State */
.empty-state {
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-state-desc {
    font-size: 0.875rem;
}

/* Responsive for Visitors Section */
@media (max-width: 1200px) {
    .visitors-content {
        grid-template-columns: 1fr;
    }
    
    .company-cards-section {
        max-height: none;
    }
    
    .company-cards-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .pipeline-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .visitor-info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .visitors-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .visitors-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .pipeline-container {
        grid-template-columns: 1fr;
    }
    
    .company-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .visitor-modal {
        padding: 1rem;
    }
    
    .visitor-overview {
        flex-direction: column;
        align-items: center;
    }
}
