/* ==========================================
   Design System - Variables & Base Styles
   ========================================== */

:root {
    /* Colors - Dark Theme */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;
    --bg-card: rgba(26, 26, 36, 0.7);

    /* Accent Colors */
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --accent-glow: rgba(99, 102, 241, 0.3);

    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Borders */
    --border-color: rgba(148, 163, 184, 0.1);
    --border-glow: rgba(99, 102, 241, 0.5);

    /* Layout */
    --sidebar-width: 240px;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--accent-glow);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ==========================================
   Reset & Base
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

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

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ==========================================
   Utilities
   ========================================== */

.glass {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.skeleton-loader {
    background: linear-gradient(90deg,
            var(--bg-tertiary) 25%,
            var(--bg-secondary) 50%,
            var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
    border-radius: var(--radius-sm);
    height: 20px;
    width: 100%;
}

@keyframes skeleton {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ==========================================
   Layout
   ========================================== */

.app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0d0d18 0%, #11111e 50%, #0f0f1b 100%);
    border-right: 1px solid rgba(99, 102, 241, 0.12);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 999;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--transition-normal);
}

.sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, rgba(99,102,241,0.3) 0%, rgba(99,102,241,0.08) 40%, transparent 100%);
    pointer-events: none;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid rgba(99, 102, 241, 0.12);
    margin-bottom: var(--spacing-lg);
}

.logo-brand-wrap {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.sidebar-close-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar-close-btn:hover {
    background: rgba(244, 63, 94, 0.15);
    border-color: rgba(244, 63, 94, 0.3);
    color: #fca5a5;
}

.logo-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(0, 201, 167, 0.35));
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    gap: 1px;
}

.logo-name {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    background: linear-gradient(120deg, #ffffff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-tagline {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem 0.25rem;
    margin-top: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.62rem 0.85rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    position: relative;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: linear-gradient(180deg, #818cf8, #6366f1);
    border-radius: 0 2px 2px 0;
    transition: height var(--transition-fast);
}

.nav-item:hover {
    background: rgba(99, 102, 241, 0.07);
    color: var(--text-primary);
}

.nav-item:hover::before {
    height: 55%;
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.13);
    color: var(--text-primary);
}

.nav-item.active::before {
    height: 65%;
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.55;
    transition: opacity var(--transition-fast), color var(--transition-fast);
    color: var(--text-secondary);
}

.nav-item:hover .nav-icon {
    opacity: 0.85;
}

.nav-item.active .nav-icon {
    opacity: 1;
    color: #818cf8;
}

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

.property-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

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

.property-info .value {
    font-family: 'SF Mono', monospace;
    color: var(--text-secondary);
}

/* Main Content */
.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
    min-width: 0;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(8, 8, 14, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    margin: calc(-1 * var(--spacing-xl)) calc(-1 * var(--spacing-xl)) 0;
    padding: 0.95rem var(--spacing-xl);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.header h1 {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.date-range select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.date-range select:hover {
    border-color: var(--accent-primary);
}

.date-range select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: var(--radius-xl);
    color: #34d399;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
}

.pulse {
    width: 7px;
    height: 7px;
    background: #10b981;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 8px #10b981;
}

.pulse::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: #10b981;
    opacity: 0.6;
    animation: radarPulse 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes radarPulse {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }
    100% {
        transform: scale(2.4);
        opacity: 0;
    }
}

.last-updated {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ==========================================
   Real-time Section
   ========================================== */

.realtime-section {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--spacing-lg);
    align-items: stretch;
    min-height: 220px;
}

.realtime-section .hourly-section {
    display: flex;
    flex-direction: column;
}

.realtime-section .chart-container-full {
    flex: 1;
    min-height: 0;
    height: auto;
}

.realtime-card {
    padding: var(--spacing-xl);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.realtime-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.3;
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.realtime-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    position: relative;
    z-index: 1;
}

.realtime-header h2 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.badge {
    padding: 2px 8px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.realtime-count {
    font-size: 4.5rem;
    font-weight: 800;
    font-feature-settings: "tnum" 1;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, #ffffff 0%, #00c9a7 50%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.03em;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 28px rgba(0, 201, 167, 0.3));
}

.realtime-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
}

/* ── Realtime benchmark indicator ───────────────────────── */
.realtime-benchmark {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(51,65,85,0.5);
    position: relative;
    z-index: 1;
    width: 100%;
}

.benchmark-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin-bottom: 6px;
}

.benchmark-avg-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.benchmark-avg-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.benchmark-delta-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.benchmark-delta {
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 6px;
    padding: 2px 8px;
}

.benchmark-delta.delta-up {
    color: #10b981;
    background: rgba(16,185,129,0.12);
}

.benchmark-delta.delta-down {
    color: #ef4444;
    background: rgba(239,68,68,0.12);
}

.benchmark-delta-label {
    font-size: 11px;
    color: var(--text-muted);
}

.realtime-countries {
    padding: var(--spacing-lg);
}

.realtime-countries h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.countries-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-sm);
    max-height: 200px;
    overflow-y: auto;
}

.country-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.country-item:hover {
    background: var(--bg-secondary);
    transform: translateX(4px);
}

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

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

/* ==========================================
   Stats Grid
   ========================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--spacing-lg);
}

.stat-card {
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.6), 0 0 24px rgba(99, 102, 241, 0.15);
}

.stat-icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.stat-icon svg {
    stroke: currentColor;
    flex-shrink: 0;
}

.stat-card:hover .stat-icon {
    transform: scale(1.08);
}

.stat-icon.sessions {
    background: rgba(99, 102, 241, 0.14);
    color: #818cf8;
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.22);
}

.stat-icon.users {
    background: rgba(139, 92, 246, 0.14);
    color: #a78bfa;
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.22);
}

.stat-icon.new-users {
    background: rgba(16, 185, 129, 0.14);
    color: #34d399;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.22);
}

.stat-icon.pageviews {
    background: rgba(59, 130, 246, 0.14);
    color: #60a5fa;
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.22);
}

.stat-icon.bounce {
    background: rgba(245, 158, 11, 0.14);
    color: #fbbf24;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.22);
}

.stat-icon.duration {
    background: rgba(236, 72, 153, 0.14);
    color: #f472b6;
    box-shadow: 0 0 16px rgba(236, 72, 153, 0.22);
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

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

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

/* ==========================================
   Charts / Cards
   ========================================== */

.chart-card {
    padding: var(--spacing-lg);
}

.chart-header {
    margin-bottom: var(--spacing-lg);
}

.chart-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

/* Devices Chart */
.devices-chart {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.device-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.device-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.device-name {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.875rem;
    color: var(--text-primary);
}

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

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

.device-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.device-bar-fill {
    height: 100%;
    border-radius: var(--radius-xl);
    transition: width 1s ease-out;
}

.device-bar-fill.mobile {
    background: var(--accent-gradient);
}

.device-bar-fill.desktop {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
}

.device-bar-fill.tablet {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
}

.device-bar-fill.other {
    background: linear-gradient(135deg, #64748b 0%, #94a3b8 100%);
}

/* Sources List */
.sources-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.source-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

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

.source-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

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

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

.source-sessions {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-primary);
}

/* ==========================================
   Table Section
   ========================================== */

.table-section {
    padding: var(--spacing-lg);
}

.table-header {
    margin-bottom: var(--spacing-lg);
}

.table-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

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

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

.data-table th,
.data-table td {
    padding: var(--spacing-md);
    text-align: left;
}

.data-table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    font-size: 0.875rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr {
    transition: all var(--transition-fast);
}

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

.page-path {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--accent-primary);
}

/* ==========================================
   Events Section
   ========================================== */

.events-section {
    padding: var(--spacing-lg);
}

.hourly-section {
    padding: var(--spacing-lg);
}

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

/* Shift Summary */
.shift-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.shift-card {
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(148,163,184,0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast);
}

.shift-card.shift-active {
    border-color: rgba(99,102,241,0.4);
    background: rgba(99,102,241,0.07);
}

.shift-card-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: 2px;
}

.shift-icon { font-size: 0.85rem; }

.shift-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.shift-now-badge {
    margin-left: auto;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--accent-primary);
    background: rgba(99,102,241,0.15);
    border: 1px solid rgba(99,102,241,0.35);
    border-radius: var(--radius-xl);
    padding: 1px 6px;
}

.shift-hours {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
}

.shift-stats {
    display: flex;
    gap: var(--spacing-md);
}

.shift-stat {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.shift-stat-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.shift-stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Hourly Section Headers */
.hourly-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

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

.today-totals {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.today-totals .icon {
    margin-right: 0.3rem;
    font-size: 1rem;
}

.today-totals .value {
    color: var(--text-primary);
    font-weight: 600;
}

.today-totals .separator {
    color: var(--text-muted);
    opacity: 0.5;
}

.hourly-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Exact data confirmed by GA4 standard report */
.dot-ga4       { background: #6366f1; }

/* Gap hours filled by page-view ratio estimation */
.dot-estimated { background: #14b8a6; }

/* Current accumulating hour (live) */
.dot-live {
    background: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245,158,11,0.25);
}

/* Raw concurrent peak — no ratio available yet */
.dot-concurrent { background: #94a3b8; }

.events-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.events-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.events-title h3 {
    font-size: 1rem;
    font-weight: 600;
}

.week-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
}

/* Tabs */
.tabs-nav {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--spacing-sm);
}

.tab-btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: transparent;
    border: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    font-family: inherit;
}

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

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

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-primary);
}

.tab-content {
    display: none;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.events-totals {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.total-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    min-width: 100px;
}

.total-badge.current {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.total-badge.previous {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.total-badge.change {
    padding: var(--spacing-md);
    font-weight: 600;
    font-size: 0.875rem;
}

.total-badge.change.up {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.total-badge.change.down {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.total-badge.change.same {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

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

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

.events-table .change-cell {
    font-weight: 600;
}

.events-table .change-cell.up {
    color: var(--success);
}

.events-table .change-cell.down {
    color: var(--danger);
}

.events-table .change-cell.same {
    color: var(--text-muted);
}

.trend-icon {
    margin-right: var(--spacing-xs);
}

/* ==========================================
   Page Container (tab show/hide)
   ========================================== */

.page-container {
    display: none;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.page-container.page-active {
    display: flex;
}

/* ==========================================
   Trending Alert
   ========================================== */

.trending-alert {
    padding: var(--spacing-lg);
    border: 1px solid rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.06);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.trending-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

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

.trending-pages {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
}

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

.trending-page-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-md);
    padding: var(--spacing-md) var(--spacing-lg);
    transition: background var(--transition-fast);
}

.trending-page-item:hover {
    background: rgba(245, 158, 11, 0.14);
}

.trending-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    word-break: break-word;
}

.trending-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.trending-users {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--warning);
    white-space: nowrap;
    margin-right: var(--spacing-xs);
}

/* Momentum chip */
.momentum-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: var(--radius-xl);
    color: var(--accent-primary);
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}

/* Source badge — base + per-source color variants */
.source-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: var(--radius-xl);
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}

.source-search {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.35);
    color: #3b82f6;
}

.source-social {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
    color: var(--success);
}

.source-direct {
    background: rgba(100, 116, 139, 0.15);
    border-color: rgba(100, 116, 139, 0.35);
    color: var(--text-muted);
}

.source-email {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.35);
    color: var(--warning);
}

.source-other {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.35);
    color: var(--accent-secondary);
}

/* ==========================================
   Spike Badge
   ========================================== */

.spike-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-md);
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: var(--radius-xl);
    color: var(--warning);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.spike-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: var(--radius-xl);
    color: var(--warning);
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}

.rise-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-xl);
    color: var(--success);
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.page-chips {
    display: flex;
    gap: var(--spacing-xs);
    margin-top: 3px;
    flex-wrap: wrap;
}

/* Age chip */
.age-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: var(--radius-xl);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Peak badge */
.peak-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: var(--radius-xl);
    color: #fbbf24;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}

/* Platform badges */
.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: var(--radius-xl);
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}
.platform-facebook  { background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.35); color: #60a5fa; }
.platform-twitter   { background: rgba(14,165,233,0.15); border: 1px solid rgba(14,165,233,0.35); color: #38bdf8; }
.platform-whatsapp  { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.35); color: #34d399; }
.platform-telegram  { background: rgba(6,182,212,0.15);  border: 1px solid rgba(6,182,212,0.35);  color: #22d3ee; }
.platform-instagram { background: rgba(236,72,153,0.15); border: 1px solid rgba(236,72,153,0.35); color: #f472b6; }
.platform-googlenews{ background: rgba(99,102,241,0.15); border: 1px solid rgba(99,102,241,0.35); color: #818cf8; }
.platform-tiktok    { background: rgba(20,20,20,0.4);    border: 1px solid rgba(255,255,255,0.15);color: #e2e8f0; }
.platform-youtube   { background: rgba(239,68,68,0.15);  border: 1px solid rgba(239,68,68,0.35);  color: #f87171; }
.platform-snapchat  { background: rgba(234,179,8,0.15);  border: 1px solid rgba(234,179,8,0.35);  color: #fde047; }
.platform-linkedin  { background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.35); color: #60a5fa; }
.platform-social    { background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.3);  color: #34d399; }

/* Geo badge */
.geo-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    background: rgba(148,163,184,0.08);
    border: 1px solid rgba(148,163,184,0.2);
    border-radius: var(--radius-xl);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Dark social badge */
.dark-social-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: rgba(139,92,246,0.15);
    border: 1px solid rgba(139,92,246,0.35);
    border-radius: var(--radius-xl);
    color: #a78bfa;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Engagement bar on trending cards */
.engagement-bar-wrapper {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-xs);
    padding-top: var(--spacing-xs);
    border-top: 1px solid rgba(148,163,184,0.08);
}
.engagement-bar-fill {
    height: 4px;
    min-width: 2px;
    max-width: 120px;
    flex: 0 0 auto;
    background: linear-gradient(90deg, #10b981, #6366f1);
    border-radius: 2px;
    transition: width 0.4s ease;
}
.engagement-bar-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Section Leaderboard */
.section-leaderboard,
.countries-leaderboard {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    flex-wrap: wrap;
}
.section-leaderboard-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    flex-shrink: 0;
}
.section-pills {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}
.section-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: var(--radius-xl);
    font-size: 0.75rem;
    white-space: nowrap;
}
.section-pill-name  { color: var(--text-secondary); font-weight: 500; }
.section-pill-count { color: var(--accent-primary); font-weight: 700; font-variant-numeric: tabular-nums; }

.fading-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-xl);
    color: #60a5fa;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Trend phase chip — declining direction (red tint, mirrors rise-chip) ── */
.fading-trend-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-xl);
    color: #f87171;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Engaged Time chip (Chartbeat parity) — 3-tier quality color ────────── */
.engaged-time-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-xl);
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}
.engaged-time-chip.engaged-strong {
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.34);
    color: #34d399;
}
.engaged-time-chip.engaged-mid {
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.32);
    color: #fbbf24;
}
.engaged-time-chip.engaged-weak {
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: #94a3b8;
}

/* ── Recirculation chip — teal tint (Chartbeat depth-of-journey) ────────── */
.recirc-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: rgba(20, 184, 166, 0.14);
    border: 1px solid rgba(20, 184, 166, 0.34);
    border-radius: var(--radius-xl);
    color: #5eead4;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Loyalty chip (New vs Returning) — Chartbeat loyalty buckets ────────── */
.loyalty-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-xl);
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}
.loyalty-chip.new-dominant {
    background: rgba(6, 182, 212, 0.14);
    border: 1px solid rgba(6, 182, 212, 0.34);
    color: #67e8f9;
}
.loyalty-chip.returning-dominant {
    background: rgba(168, 85, 247, 0.14);
    border: 1px solid rgba(168, 85, 247, 0.34);
    color: #c4b5fd;
}

/* ── Per-row source mini-chip — compact version of source-badge ─────────── */
.source-mini-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: var(--radius-xl);
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.18);
    font-size: 0.7rem;
    opacity: 0.85;
}

/* ── Section pill clickable + active states (filter UX) ─────────────────── */
.section-pill-clickable { cursor: pointer; transition: all 0.15s ease; }
.section-pill-clickable:hover {
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(99, 102, 241, 0.45);
}
.section-pill.section-pill-active {
    background: rgba(99, 102, 241, 0.55);
    border-color: rgba(99, 102, 241, 0.85);
}
.section-pill.section-pill-active .section-pill-name,
.section-pill.section-pill-active .section-pill-count { color: #fff; }
.author-pill {
    background: rgba(168, 85, 247, 0.08);
    border-color: rgba(168, 85, 247, 0.25);
}
.author-pill .section-pill-count { color: #c4b5fd; }

/* ── Device mix row beneath live users card ─────────────────────────────── */
.device-mix {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: var(--spacing-sm);
    font-size: 0.78rem;
}
.device-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-xl);
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: var(--text-secondary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.device-sep { color: var(--text-muted); padding: 0 2px; }

/* ── Audience Loyalty mix row beneath live users card ───────────────────── */
.loyalty-mix {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 0.74rem;
}
.loyalty-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: var(--radius-xl);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}
.loyalty-pill strong { font-weight: 700; }
.loyalty-pill.pill-new {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.28);
    color: #4ade80;
}
.loyalty-pill.pill-returning {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.28);
    color: #60a5fa;
}
.loyalty-pill.pill-loyal {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.28);
    color: #fbbf24;
}

/* ── Tag Leaderboard pill ──────────────────────────────────────────────── */
.tag-pill {
    background: rgba(236, 72, 153, 0.08);
    border-color: rgba(236, 72, 153, 0.25);
}
.tag-pill .section-pill-count { color: #f472b6; }
.tag-pill.section-pill-active {
    background: #ec4899;
    border-color: #ec4899;
    color: #fff;
}
.tag-pill.section-pill-active .section-pill-count { color: #fff; }

/* ── Content Age / Publish Date Chips ────────────────────────────────── */
.publish-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.71rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
}
.publish-breaking {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #f87171;
}
.publish-today {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: #93c5fd;
}
.publish-evergreen {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #6ee7b7;
}

/* ── Loyalty Chips on Table Rows ─────────────────────────────────────── */
.loyalty-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.71rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
}
.chip-new {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #86efac;
}
.chip-loyal {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #fcd34d;
}
.meta-tag-item {
    color: #c084fc;
    font-size: 0.74rem;
    font-weight: 500;
    margin-right: 4px;
}

/* ── Live Pages controls (sort dropdown) ────────────────────────────────── */
.live-pages-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}
.sort-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.sort-label .sort-icon { font-size: 0.85rem; }
.sort-label select {
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-primary);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 0.78rem;
    cursor: pointer;
}
.sort-label select:hover { border-color: rgba(99, 102, 241, 0.5); }

/* ── 2-hour site-wide concurrents strip (Chartbeat top-of-board parity) ───── */
.concurrents-2h {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
}
.concurrents-2h-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--spacing-xs);
}
.concurrents-2h-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.concurrents-2h-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.concurrents-2h-chart {
    height: 70px;
    width: 100%;
}

/* ── Sidebar "Open Big Board" launcher ───────────────────────────────────── */
.bigboard-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    margin-bottom: var(--spacing-sm);
    background: rgba(99,102,241,0.12);
    border: 1px solid rgba(99,102,241,0.32);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.18s ease;
}
.bigboard-link:hover {
    background: rgba(99,102,241,0.22);
    border-color: rgba(99,102,241,0.6);
    transform: translateY(-1px);
}

/* ── Arabic tooltips on chips ─────────────────────────────────────────────── */
.has-tooltip {
    position: relative;
    cursor: help;
}

.has-tooltip::after {
    content: attr(data-tooltip);
    direction: rtl;
    font-family: inherit;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 20, 35, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.6;
    color: #e2e8f0;
    white-space: normal;
    width: 260px;
    text-align: right;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
    transform: translateX(-50%) translateY(4px);
    z-index: 999;
}

.has-tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Arrow pointing down from tooltip */
.has-tooltip::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(255, 255, 255, 0.1);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
    z-index: 1000;
}

.has-tooltip:hover::before {
    opacity: 1;
}

.new-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.5);
    border-radius: var(--radius-xl);
    color: #34d399;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

/* Velocity arrows */
.velocity-up,
.velocity-down,
.velocity-stable {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    margin-top: 2px;
}
.velocity-up     { color: #10b981; }
.velocity-down   { color: #ef4444; }
.velocity-stable { color: var(--text-muted); }

/* Refresh countdown */
.refresh-countdown {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 2px 8px;
    white-space: nowrap;
}

/* Traffic concentration bar */
.concentration-wrapper {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.concentration-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.concentration-label strong {
    color: var(--text-secondary);
}

.concentration-track {
    width: 100px;
    height: 6px;
    background: rgba(148, 163, 184, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.concentration-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* ==========================================
   Live Pages Section
   ========================================== */

.live-pages-section {
    padding: var(--spacing-lg);
}

.live-pages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.live-pages-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.live-pages-title h3 {
    font-size: 1rem;
    font-weight: 600;
}

.live-pages-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: var(--spacing-xs);
}

.live-pages-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Live Pages Table */

.live-pages-table .live-page-row {
    transition: background var(--transition-fast);
}

.live-pages-table .live-page-row:hover {
    background: var(--bg-tertiary);
}

@keyframes flashGreen {
    0%   { background: rgba(16, 185, 129, 0.18); }
    100% { background: transparent; }
}

.live-pages-table .flash-increase {
    animation: flashGreen 0.8s ease-out forwards;
}

.live-page-path-cell {
    max-width: 520px;
    width: 100%;
}

.live-page-path {
    color: var(--accent-primary);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
}

.live-page-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
    margin-bottom: 1px;
    flex-wrap: wrap;
}

.meta-section {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-secondary);
    background: rgba(139,92,246,0.1);
    border: 1px solid rgba(139,92,246,0.25);
    border-radius: var(--radius-sm);
    padding: 1px 6px;
}

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

.meta-author {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.live-users-cell {
    text-align: center;
    white-space: nowrap;
}

.live-users-count {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.sparkline-cell {
    text-align: center;
    vertical-align: middle;
}

.sparkline-svg {
    display: block;
    margin: 0 auto;
    overflow: visible;
}

/* ==========================================
   Hamburger & Sidebar Overlay (mobile)
   ========================================== */

.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex-shrink: 0;
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

.hamburger-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
}

.hamburger-btn:hover span {
    background: var(--text-primary);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.sidebar.sidebar-open {
    transform: translateX(0) !important;
    box-shadow: 4px 0 40px rgba(0, 0, 0, 0.6);
}

/* ==========================================
   Responsive Design (Mobile & Tablet)
   ========================================== */

@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1200px) {
    .realtime-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    body.sidebar-active {
        overflow: hidden;
    }

    .sidebar {
        transform: translateX(-100%);
        width: min(300px, 85vw);
        z-index: 1100 !important;
        box-shadow: none;
        background: linear-gradient(180deg, #0e1220 0%, #070912 100%);
        border-right: 1px solid rgba(99, 102, 241, 0.22);
        pointer-events: auto;
    }

    .sidebar.sidebar-open {
        transform: translateX(0) !important;
        box-shadow: 12px 0 50px rgba(0, 0, 0, 0.85);
        pointer-events: auto !important;
    }

    .sidebar-close-btn {
        display: flex;
    }

    .sidebar-overlay {
        display: block;
        z-index: 1050;
        pointer-events: none;
    }

    .sidebar-overlay.active {
        pointer-events: auto;
        opacity: 1;
    }

    .sidebar .nav-item {
        padding: 0.75rem 0.9rem;
        font-size: 0.92rem;
    }

    .sidebar .bigboard-link {
        padding: 0.75rem 0.9rem;
        font-size: 0.9rem;
    }

    .main {
        margin-left: 0;
        padding: var(--spacing-lg);
    }

    .hamburger-btn {
        display: flex;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .header {
        margin: calc(-1 * var(--spacing-lg)) calc(-1 * var(--spacing-lg)) 0;
        padding: 0.85rem var(--spacing-lg);
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0.75rem 1rem;
    }

    .header-left {
        gap: 0.75rem;
    }

    .header-right {
        gap: 0.55rem;
    }

    .last-updated {
        display: none;
    }

    .refresh-countdown {
        font-size: 0.73rem;
        padding: 2px 7px;
        border-radius: 999px;
        background: rgba(99, 102, 241, 0.15);
        color: #a5b4fc;
    }
}

@media (max-width: 640px) {
    .main {
        padding: var(--spacing-md);
        gap: var(--spacing-lg);
    }

    .header {
        margin: calc(-1 * var(--spacing-md)) calc(-1 * var(--spacing-md)) 0;
        padding: 0.65rem 0.8rem;
    }

    .header-left {
        gap: 0.5rem;
    }

    .header h1 {
        font-size: 1.15rem;
    }

    .header-right {
        gap: 0.45rem;
    }

    .live-indicator {
        padding: 0.2rem 0.55rem;
        font-size: 0.68rem;
    }

    .date-range select {
        padding: 0.35rem 0.55rem;
        font-size: 0.78rem;
        max-width: 125px;
    }

    /* Mobile Compact User Profile Button */
    .user-strip {
        padding: 2px;
        background: transparent;
        border-color: transparent;
        gap: 0;
    }

    .user-strip:hover {
        background: rgba(99, 102, 241, 0.15);
        border-color: rgba(99, 102, 241, 0.3);
    }

    .user-info {
        display: none;
    }

    .user-menu-btn {
        display: none;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .user-dropdown {
        top: calc(var(--header-height, 54px) + 6px);
        right: 0.6rem;
        min-width: 215px;
        max-width: calc(100vw - 1.2rem);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0.55rem 0.65rem;
    }

    .hamburger-btn {
        width: 34px;
        height: 34px;
        padding: 6px;
    }

    .live-indicator-text {
        display: none;
    }

    .live-indicator {
        padding: 0.35rem;
        border-radius: 50%;
        width: 28px;
        height: 28px;
        justify-content: center;
    }

    .pulse {
        margin: 0;
    }
}

/* ==========================================
   Scrollbar Styling
   ========================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: var(--radius-xl);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: var(--radius-xl);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ============================================================
   Auth UI — user strip, dropdown, modals
   ============================================================ */

/* ── User strip in header ────────────────────────────────── */
.user-strip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.3rem 0.75rem 0.3rem 0.35rem;
    background: rgba(99, 102, 241, 0.09);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

.user-strip:hover {
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.2);
    transform: translateY(-1px);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00c9a7 0%, #6366f1 100%);
    font-size: 0.72rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 12px rgba(0, 201, 167, 0.35);
    flex-shrink: 0;
    letter-spacing: 0.04em;
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

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

.user-role-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 999px;
    display: inline-block;
    width: fit-content;
}

.user-role-badge.role-admin,
.user-role-badge.role-super_admin { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }
.user-role-badge.role-org_admin   { background: rgba(245, 158, 11, 0.2); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.3); }
.user-role-badge.role-editor      { background: rgba(0, 201, 167, 0.2); color: #5eead4; border: 1px solid rgba(0, 201, 167, 0.3); }
.user-role-badge.role-viewer      { background: rgba(99, 102, 241, 0.2); color: #c7d2fe; border: 1px solid rgba(99, 102, 241, 0.3); }

.user-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: color 0.15s, transform 0.15s;
    line-height: 1;
}

.user-strip:hover .user-menu-btn {
    color: var(--text-primary);
    transform: translateY(1px);
}

/* ── Dropdown ────────────────────────────────────────────── */
.user-dropdown {
    position: absolute;
    top: calc(var(--header-height, 72px) + 8px);
    right: 1.5rem;
    z-index: 900;
    min-width: 230px;
    padding: 0.5rem 0.35rem;
    border-radius: 16px;
    background: rgba(14, 21, 38, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow:
        0 20px 50px -10px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(99, 102, 241, 0.15);
    animation: fadeSlideDown 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.dropdown-header {
    padding: 0.75rem 1rem 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.dropdown-username {
    font-weight: 700;
    font-size: 0.92rem;
    color: #ffffff;
}

.dropdown-email {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.dropdown-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin: 0.35rem 0.5rem;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 0.6rem 0.9rem;
    font-size: 0.86rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-secondary);
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.dropdown-item svg {
    stroke: currentColor;
    flex-shrink: 0;
}

.dropdown-item:hover {
    background: rgba(99, 102, 241, 0.14);
    color: #ffffff;
    transform: translateX(2px);
}

.dropdown-item.danger {
    color: #fda4af;
}

.dropdown-item.danger:hover {
    background: rgba(244, 63, 94, 0.15);
    color: #ffffff;
}

/* ── Modals ──────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.8rem;
    border-radius: 18px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.6);
    animation: slideUp 0.22s ease;
}
.modal-wide { max-width: 860px; }

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.4rem;
}
.modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    transition: background 0.15s;
}
.modal-close:hover { background: rgba(148,163,184,0.12); color: var(--text-primary); }

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.field-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    margin-bottom: -0.3rem;
}
.field-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 0.4rem;
}
.modal-input {
    width: 100%;
    background: rgba(15,23,42,0.55);
    border: 1px solid rgba(99,102,241,0.22);
    border-radius: 9px;
    padding: 0.7rem 0.9rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.modal-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.modal-select { cursor: pointer; }
.modal-select option { background: #1a1a24; }

.modal-error {
    padding: 0.65rem 0.9rem;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 8px;
    font-size: 0.85rem;
    color: #fca5a5;
}
.modal-success {
    padding: 0.65rem 0.9rem;
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.3);
    border-radius: 8px;
    font-size: 0.85rem;
    color: #6ee7b7;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 0.4rem;
}

.btn-primary {
    padding: 0.6rem 1.3rem;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.87rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-secondary {
    padding: 0.6rem 1.3rem;
    background: rgba(148,163,184,0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.87rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-secondary:hover { background: rgba(148,163,184,0.18); color: var(--text-primary); }
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.82rem; }

/* ── Tab checkboxes in user form ─────────────────────────── */
.tab-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.tab-check {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.83rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    transition: border-color 0.15s, background 0.15s;
}
.tab-check:has(input:checked) {
    border-color: rgba(99,102,241,0.5);
    background: rgba(99,102,241,0.1);
    color: var(--text-primary);
}
.tab-check-hint {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    margin-top: -0.2rem;
}

/* ── User Management table ───────────────────────────────── */
.um-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}
.um-table .um-actions {
    display: flex;
    gap: 0.3rem;
    justify-content: center;
}
.btn-icon {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-icon:hover         { background: rgba(148,163,184,0.12); }
.btn-icon.danger:hover  { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.3); }
.text-dim { color: var(--text-muted); }

.status-badge {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}
.status-badge.active   { background: rgba(16,185,129,0.15); color: #6ee7b7; }
.status-badge.inactive { background: rgba(239,68,68,0.12);  color: #fca5a5; }

.role-pill {
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}
.role-pill.role-admin  { background: rgba(239,68,68,0.15);  color: #fca5a5; }
.role-pill.role-editor { background: rgba(245,158,11,0.15); color: #fcd34d; }
.role-pill.role-viewer { background: rgba(99,102,241,0.15); color: #a5b4fc; }

.self-badge {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* ==========================================
   Property Switcher (sidebar footer)
   ========================================== */

.property-switcher {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: var(--radius-sm);
}

.property-switcher-label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.property-select {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    padding-right: 1rem;
}

.property-select option {
    background: #1a1a24;
    color: var(--text-primary);
}

/* ==========================================
   Property Type Selector (wizard)
   ========================================== */

.property-type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.type-card {
    display: block;
    cursor: pointer;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    transition: border-color 0.15s, background 0.15s;
    position: relative;
}

.type-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.type-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    pointer-events: none;
}

.type-card .type-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.type-card strong {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.type-card span {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.type-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.05);
}

.type-card:has(input:checked) {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.35);
}

.type-card:has(input:checked) strong {
    color: #a5b4fc;
}

/* Install Code block */
.install-code-block {
    position: relative;
    background: rgba(10, 10, 20, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.5rem;
}

.install-code-pre {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.78rem;
    color: #a5f3fc;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    line-height: 1.6;
}

.copy-code-btn {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #a5b4fc;
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.copy-code-btn:hover {
    background: rgba(99, 102, 241, 0.28);
}

.copy-code-btn.copied {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}

/* Property type badge in header */
.prop-type-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    vertical-align: middle;
    margin-right: 6px;
}

.prop-type-chip.snippet {
    background: rgba(99, 102, 241, 0.18);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.35);
}

.prop-type-chip.ga4 {
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ==========================================
   Property Wizard Modal
   ========================================== */

.wizard-modal {
    max-width: 560px;
    width: 90vw;
}

.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 1.5rem 0 2rem;
}

.wizard-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.wizard-step-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    color: var(--text-muted);
    transition: all 0.2s;
}

.wizard-step-dot.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
    box-shadow: 0 0 12px var(--accent-glow);
}

.wizard-step-dot.done {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #6ee7b7;
}

.wizard-step-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.wizard-step-connector {
    flex: 1;
    height: 2px;
    background: var(--border-color);
    margin: 0 0.5rem;
    margin-bottom: 1rem;
    min-width: 40px;
}

.wizard-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.wizard-msg {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    background: rgba(0,0,0,0.2);
}

.modal-textarea {
    font-family: monospace;
    font-size: 0.75rem;
    resize: vertical;
    min-height: 120px;
}

.sa-upload-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.sa-upload-btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* Access user list in wizard Step 3 */
.access-user-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 220px;
    overflow-y: auto;
    padding: 0.5rem;
    background: rgba(0,0,0,0.15);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.access-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.access-toggle:hover {
    background: rgba(99, 102, 241, 0.08);
}

.access-toggle input[type="checkbox"] {
    accent-color: var(--accent-primary);
    width: 15px;
    height: 15px;
}

/* ==========================================
   Shared: btn-sm (used in property table too)
   ========================================== */

.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.btn-sm:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }
.btn-sm.danger { border-color: rgba(239,68,68,0.3); color: #fca5a5; }
.btn-sm.danger:hover { background: rgba(239,68,68,0.1); }