@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-dark: #0a0a1a;
    --bg-primary: #0f1219;
    --bg-secondary: #161b26;
    --bg-tertiary: #1e2533;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #3b82f6;
    --accent-purple: #a78bfa;
    --accent-teal: #2dd4bf;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(139, 92, 246, 0.3);
    --glow-purple: rgba(139, 92, 246, 0.15);
    --glow-blue: rgba(59, 130, 246, 0.15);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Animated background */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 20% 0%, var(--glow-purple) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, var(--glow-blue) 0%, transparent 50%),
        var(--bg-dark);
}

.bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(180deg, transparent 0%, black 20%, black 80%, transparent 100%);
}

/* Data Streams - vertical flowing lines */
.data-streams {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.stream {
    position: absolute;
    width: 1px;
    height: 100%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(139, 92, 246, 0.15) 20%,
        rgba(59, 130, 246, 0.25) 50%,
        rgba(139, 92, 246, 0.15) 80%,
        transparent 100%
    );
    animation: stream-flow 8s linear infinite;
}

.stream::after {
    content: '';
    position: absolute;
    top: 0;
    left: -2px;
    width: 5px;
    height: 30px;
    background: linear-gradient(180deg, transparent, rgba(59, 130, 246, 0.4), transparent);
    border-radius: 2px;
    animation: stream-pulse 3s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.2);
}

.stream-1 { left: 5%; animation-duration: 45s; animation-delay: 0s; opacity: 0.15; }
.stream-2 { left: 18%; animation-duration: 52s; animation-delay: 12s; opacity: 0.2; }
.stream-3 { left: 42%; animation-duration: 48s; animation-delay: 8s; opacity: 0.12; }
.stream-4 { left: 71%; animation-duration: 55s; animation-delay: 20s; opacity: 0.18; }
.stream-5 { left: 88%; animation-duration: 50s; animation-delay: 25s; opacity: 0.15; }

.stream-1::after { animation-duration: 22s; animation-delay: 5s; }
.stream-2::after { animation-duration: 18s; animation-delay: 15s; }
.stream-3::after { animation-duration: 25s; animation-delay: 0s; }
.stream-4::after { animation-duration: 20s; animation-delay: 10s; }
.stream-5::after { animation-duration: 23s; animation-delay: 18s; }

/* Data Particles - floating dots like events */
.data-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.3);
    box-shadow: 0 0 4px rgba(139, 92, 246, 0.2);
    animation: particle-rise 15s ease-in-out infinite;
}

/* Circular particles */
.particle-1 { left: 8%; bottom: -10px; animation-duration: 65s; animation-delay: 0s; }
.particle-2 { left: 24%; bottom: -10px; animation-duration: 55s; animation-delay: 15s; background: rgba(59, 130, 246, 0.25); box-shadow: 0 0 4px rgba(59, 130, 246, 0.15); }
.particle-3 { left: 35%; bottom: -10px; animation-duration: 70s; animation-delay: 30s; }
.particle-4 { left: 48%; bottom: -10px; animation-duration: 60s; animation-delay: 10s; background: rgba(45, 212, 191, 0.2); box-shadow: 0 0 4px rgba(45, 212, 191, 0.1); }
.particle-5 { left: 62%; bottom: -10px; animation-duration: 58s; animation-delay: 25s; background: rgba(59, 130, 246, 0.25); box-shadow: 0 0 4px rgba(59, 130, 246, 0.15); }
.particle-6 { left: 76%; bottom: -10px; animation-duration: 63s; animation-delay: 40s; }
.particle-7 { left: 85%; bottom: -10px; animation-duration: 68s; animation-delay: 35s; background: rgba(45, 212, 191, 0.2); box-shadow: 0 0 4px rgba(45, 212, 191, 0.1); }
.particle-8 { left: 94%; bottom: -10px; animation-duration: 72s; animation-delay: 50s; background: rgba(59, 130, 246, 0.25); box-shadow: 0 0 4px rgba(59, 130, 246, 0.15); }

/* Diamond shapes - using rotated squares */
.particle-3,
.particle-6 {
    width: 5px;
    height: 5px;
    border-radius: 1px;
    transform: rotate(45deg);
}

/* Larger, slower floating shapes */
.particle-4,
.particle-7 {
    width: 6px;
    height: 6px;
}

/* Scan line effect */
.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(59, 130, 246, 0.04) 20%,
        rgba(139, 92, 246, 0.08) 50%,
        rgba(59, 130, 246, 0.04) 80%,
        transparent 100%
    );
    animation: scan 25s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.05);
}

@keyframes stream-flow {
    0% {
        opacity: 0;
        transform: translateY(-100%);
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% {
        opacity: 0;
        transform: translateY(100%);
    }
}

@keyframes stream-pulse {
    0%, 100% {
        transform: translateY(0);
        opacity: 0;
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% {
        transform: translateY(calc(100vh + 30px));
        opacity: 0;
    }
}

@keyframes particle-rise {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    5% { opacity: 0.8; }
    50% {
        transform: translateY(-50vh) translateX(20px);
        opacity: 0.6;
    }
    95% { opacity: 0.3; }
    100% {
        transform: translateY(-110vh) translateX(-10px);
        opacity: 0;
    }
}

@keyframes scan {
    0%, 100% {
        top: -2px;
        opacity: 0;
    }
    5% { opacity: 1; }
    95% { opacity: 1; }
    100% {
        top: 100%;
        opacity: 0;
    }
}

/* Header */
.header {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(22, 27, 38, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    flex-shrink: 0;
}

/* Gradient border effect on header */
.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(139, 92, 246, 0.5) 20%,
        rgba(59, 130, 246, 0.5) 50%,
        rgba(139, 92, 246, 0.5) 80%,
        transparent
    );
}

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

.back-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.5rem 0.875rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.back-link:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

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

.header h1 {
    font-size: 1.375rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

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

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 500;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.status-indicator:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    position: relative;
}

.status-indicator.connected {
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.05);
}

.status-indicator.connected .status-dot {
    background: var(--success);
    box-shadow: 0 0 12px var(--success);
    animation: live-pulse 2s ease-in-out infinite;
}

/* Ripple effect for connected status */
.status-indicator.connected .status-dot::before,
.status-indicator.connected .status-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid var(--success);
    transform: translate(-50%, -50%);
    animation: ripple 2s ease-out infinite;
}

.status-indicator.connected .status-dot::after {
    animation-delay: 1s;
}

@keyframes live-pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 12px var(--success);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 20px var(--success);
    }
}

@keyframes ripple {
    0% {
        width: 100%;
        height: 100%;
        opacity: 0.8;
    }
    100% {
        width: 300%;
        height: 300%;
        opacity: 0;
    }
}

/* Main layout */
.main {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 380px;
    flex: 1;
    overflow: hidden;
}

/* Section headers with badges */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.section-header h2 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent-purple);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 20px;
    padding: 0 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(59, 130, 246, 0.2));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.section-badge.pulse {
    animation: badge-pulse 3s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.3); }
    50% { box-shadow: 0 0 10px 2px rgba(139, 92, 246, 0.2); }
}

/* Team grid */
.team-grid {
    padding: 2rem;
    overflow-y: auto;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

/* User card */
.user-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
}

/* Call volume indicator - subtle background intensity */
.user-card[data-call-volume="low"] {
    --volume-opacity: 0.03;
}
.user-card[data-call-volume="medium"] {
    --volume-opacity: 0.06;
}
.user-card[data-call-volume="high"] {
    --volume-opacity: 0.1;
}
.user-card[data-call-volume="very-high"] {
    --volume-opacity: 0.15;
}

/* Volume indicator background glow */
.user-card .volume-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(
        0deg,
        rgba(139, 92, 246, var(--volume-opacity, 0)) 0%,
        transparent 60%
    );
    pointer-events: none;
    transition: opacity 0.5s ease;
}

/* Volume bar at bottom of card */
.user-card .volume-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent));
    border-radius: 0 3px 0 0;
    transition: width 0.5s ease;
    opacity: 0.7;
}

.user-card:hover .volume-bar {
    opacity: 1;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

/* Subtle inner glow effect */
.user-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
}

/* Shimmer highlight effect on hover */
.user-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.03),
        transparent
    );
    transition: left 0.5s ease;
    pointer-events: none;
}

.user-card:hover::after {
    left: 100%;
}

.user-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-6px);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(139, 92, 246, 0.08);
}

.user-card.on-call {
    border-color: rgba(59, 130, 246, 0.5);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), transparent);
    box-shadow:
        0 0 40px rgba(59, 130, 246, 0.15),
        inset 0 0 30px rgba(59, 130, 246, 0.05);
}

.user-card.ringing {
    border-color: rgba(245, 158, 11, 0.5);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), transparent);
    animation: ring-pulse 1.5s ease-in-out infinite;
}

@keyframes ring-pulse {
    0%, 100% {
        box-shadow:
            0 0 0 0 rgba(245, 158, 11, 0.4),
            inset 0 0 30px rgba(245, 158, 11, 0.05);
        transform: scale(1);
    }
    50% {
        box-shadow:
            0 0 25px 5px rgba(245, 158, 11, 0.15),
            inset 0 0 30px rgba(245, 158, 11, 0.08);
        transform: scale(1.02);
    }
}

.user-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

.user-card:hover .user-avatar {
    border-color: var(--accent-purple);
    transform: scale(1.05);
}

.user-card.on-call .user-avatar {
    border-color: var(--accent);
    box-shadow:
        0 0 20px rgba(59, 130, 246, 0.4),
        0 0 40px rgba(59, 130, 246, 0.2);
    animation: avatar-glow 2s ease-in-out infinite;
}

@keyframes avatar-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.4), 0 0 40px rgba(59, 130, 246, 0.2); }
    50% { box-shadow: 0 0 30px rgba(59, 130, 246, 0.5), 0 0 60px rgba(59, 130, 246, 0.3); }
}

.user-card.ringing .user-avatar {
    border-color: var(--warning);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.user-name {
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
}

.user-extension {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

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

.user-status.available { color: var(--success); }
.user-status.on_call { color: var(--accent); }
.user-status.ringing { color: var(--warning); }
.user-status.dialing { color: var(--warning); }

.user-timer {
    font-size: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    color: var(--accent);
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.user-timer::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: timer-blink 1s ease-in-out infinite;
    box-shadow: 0 0 8px var(--accent);
}

@keyframes timer-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.user-caller {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Empty states */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-muted);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.03), transparent);
    border: 1px dashed var(--border);
    border-radius: 16px;
    animation: empty-fade-in 0.5s ease;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
    animation: float 4s ease-in-out infinite;
}

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

@keyframes empty-fade-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.empty-state p {
    margin: 0;
    line-height: 1.5;
}

.empty-state p:first-of-type {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

/* Value changed animation */
.value-changed {
    animation: value-pop 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes value-pop {
    0% { transform: scale(1); }
    30% { transform: scale(1.15); color: var(--accent-purple); }
    100% { transform: scale(1); }
}

/* Live feed */
.live-feed {
    background: rgba(22, 27, 38, 0.6);
    backdrop-filter: blur(12px);
    border-left: 1px solid var(--border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.live-feed .section-header {
    flex-shrink: 0;
}

.live-feed .section-header h2 {
    color: var(--accent-teal);
}

.live-feed .section-badge {
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.3), rgba(59, 130, 246, 0.2));
    border-color: rgba(45, 212, 191, 0.3);
}

.feed-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.feed-item {
    display: flex;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.875rem;
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 0.25s ease;
    position: relative;
}

.feed-item::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 0;
    background: var(--accent-purple);
    border-radius: 1px;
    transition: height 0.2s ease;
}

.feed-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateX(4px);
}

.feed-item:hover::after {
    height: 60%;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.feed-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.feed-item:hover .feed-icon {
    transform: scale(1.1);
}

.feed-icon.call-started {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(59, 130, 246, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}
.feed-icon.call-ended {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(239, 68, 68, 0.1));
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}
.feed-icon.call-answered {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.25), rgba(34, 197, 94, 0.1));
    border: 1px solid rgba(34, 197, 94, 0.3);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
}
.feed-icon.transcript {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(168, 85, 247, 0.1));
    border: 1px solid rgba(168, 85, 247, 0.3);
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.15);
}

.feed-content {
    flex: 1;
    min-width: 0;
}

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

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

.feed-time {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
}

/* Stats bar */
.stats-bar {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(22, 27, 38, 0.8);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    gap: 2rem;
}

.stats-section {
    display: flex;
    gap: 2rem;
}

.stat {
    text-align: center;
    position: relative;
}

.stat:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 2.5rem;
    background: var(--border);
}

.stat-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    background: linear-gradient(135deg, var(--text-primary), rgba(139, 92, 246, 0.8));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sparkline {
    width: 50px;
    height: 20px;
    overflow: visible;
}

.sparkline path {
    fill: none;
    stroke: var(--accent-purple);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sparkline circle {
    fill: var(--accent-purple);
}

.stat-label {
    font-size: 0.625rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.25rem;
}

/* Chart section */
.chart-section {
    flex: 1;
    max-width: 400px;
    background: linear-gradient(135deg, var(--bg-card), rgba(139, 92, 246, 0.03));
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.875rem 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

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

.chart-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--accent-teal);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chart-subtitle {
    font-size: 0.625rem;
    color: var(--text-muted);
}

.hourly-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 40px;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(180deg, var(--accent) 0%, rgba(59, 130, 246, 0.3) 100%);
    border-radius: 3px 3px 0 0;
    min-height: 3px;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.2);
}

.chart-bar.recent {
    background: linear-gradient(180deg, var(--accent-purple) 0%, rgba(139, 92, 246, 0.3) 100%);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.chart-bar:hover {
    background: linear-gradient(180deg, var(--accent-purple) 0%, rgba(139, 92, 246, 0.4) 100%);
    transform: scaleY(1.1);
    transform-origin: bottom;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

.chart-bar::after {
    content: attr(data-label);
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.5rem;
    color: var(--text-muted);
    white-space: nowrap;
    display: none;
}

.chart-bar:first-child::after,
.chart-bar:nth-child(4)::after,
.chart-bar:nth-child(7)::after,
.chart-bar:nth-child(10)::after,
.chart-bar:last-child::after {
    display: block;
}

/* Detail panel */
.detail-panel {
    position: fixed;
    top: 0;
    right: -420px;
    width: 420px;
    height: 100vh;
    background: rgba(22, 27, 38, 0.95);
    backdrop-filter: blur(16px);
    border-left: 1px solid var(--border);
    transition: right 0.3s ease;
    z-index: 100;
    overflow-y: auto;
}

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

.detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 99;
}

.detail-overlay.open {
    opacity: 1;
    visibility: visible;
}

.detail-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.05) 0%, transparent 100%);
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s;
}

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

.detail-user {
    text-align: center;
    padding-top: 1rem;
}

.detail-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: 3px solid var(--border);
}

.detail-name {
    font-size: 1.375rem;
    font-weight: 600;
}

.detail-extension {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-family: 'JetBrains Mono', monospace;
    margin-top: 0.25rem;
}

.detail-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
}

.detail-stat {
    text-align: center;
    padding: 0.75rem 0.5rem;
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.detail-stat.primary {
    grid-column: span 1;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-color: rgba(139, 92, 246, 0.2);
}

.detail-stat.primary .detail-stat-value {
    color: var(--accent-purple);
}

.detail-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.detail-stat-label {
    font-size: 0.625rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* Detail panel charts */
.detail-charts {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
}

.detail-chart-section {
    margin-bottom: 1.5rem;
}

.detail-chart-header {
    margin-bottom: 0.75rem;
}

.detail-chart-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--accent-teal);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-hourly-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 50px;
    padding: 0.5rem;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.detail-chart-bar {
    flex: 1;
    background: rgba(100, 116, 139, 0.3);
    border-radius: 2px 2px 0 0;
    min-height: 4px;
    transition: all 0.3s ease;
}

.detail-chart-bar.has-calls {
    background: linear-gradient(180deg, var(--accent) 0%, rgba(59, 130, 246, 0.4) 100%);
}

.detail-chart-bar.recent.has-calls {
    background: linear-gradient(180deg, var(--accent-purple) 0%, rgba(139, 92, 246, 0.4) 100%);
}

/* Call direction breakdown */
.detail-breakdown {
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 1rem;
}

.breakdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.breakdown-counts {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.breakdown-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.breakdown-inbound {
    background: linear-gradient(90deg, var(--success), rgba(34, 197, 94, 0.6));
    transition: width 0.5s ease;
}

.breakdown-outbound {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.6), var(--accent));
    transition: width 0.5s ease;
}

.breakdown-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.inbound-label {
    color: var(--success);
}

.outbound-label {
    color: var(--accent);
}

.detail-calls {
    padding: 1.5rem 2rem;
}

.detail-calls h3 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent-purple);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.calls-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.call-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    transition: all 0.2s;
}

.call-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.call-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.call-direction {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.call-direction.inbound {
    color: var(--success);
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
}
.call-direction.outbound {
    color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.call-phone {
    font-weight: 600;
    font-size: 0.9375rem;
}

.call-duration {
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

.call-time {
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
}

.call-transcript {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.call-transcript-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent-purple);
    cursor: pointer;
    padding: 0.375rem 0.625rem;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 6px;
    transition: all 0.2s;
}

.call-transcript-badge:hover {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.3);
}

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

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

.empty-state p {
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

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

/* Call item meta row */
.call-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.25rem;
}

/* Transcript button */
.transcript-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--accent-purple);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 6px;
    transition: all 0.2s;
}

.transcript-btn:hover {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.3);
}

/* Transcript Modal */
.transcript-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 2rem;
}

.transcript-modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.transcript-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.05) 0%, transparent 100%);
    position: sticky;
    top: 0;
    z-index: 1;
}

.transcript-modal-header h3 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-purple);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.transcript-meta {
    display: flex;
    justify-content: space-between;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.transcript-summary {
    padding: 1rem 2rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    line-height: 1.6;
}

.transcript-summary strong {
    color: var(--accent-teal);
    font-weight: 500;
}

.transcript-sentiment {
    padding: 0.75rem 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.transcript-sentiment.positive {
    color: var(--success);
    background: rgba(34, 197, 94, 0.05);
}

.transcript-sentiment.negative {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

.transcript-sentiment.neutral {
    color: var(--text-muted);
    background: var(--bg-card);
}

.transcript-text {
    padding: 1.5rem 2rem;
    font-size: 0.875rem;
    line-height: 1.8;
}

.transcript-text p {
    margin-bottom: 0.75rem;
}

.transcript-text p:last-child {
    margin-bottom: 0;
}

.transcript-text strong {
    color: var(--accent-purple);
}

/* iPad and tablet responsive */
@media (max-width: 1024px) {
    .main {
        grid-template-columns: 1fr;
    }

    .live-feed {
        display: none;
    }

    .stats-bar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .stats-section {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .chart-section {
        width: 100%;
        max-width: none;
    }

    .stat:not(:last-child)::after {
        display: none;
    }
}

/* iOS Safari viewport fix */
@supports (-webkit-touch-callout: none) {
    body {
        height: -webkit-fill-available;
        min-height: -webkit-fill-available;
    }
}

/* Smaller phones */
@media (max-width: 600px) {
    .header {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }

    .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .sparkline {
        display: none;
    }
}

/* Debug Modal */
.debug-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: rgba(22, 27, 38, 0.98);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 90%;
    max-width: 380px;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.debug-modal.open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.debug-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.debug-overlay.open {
    opacity: 1;
    visibility: visible;
}

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

.debug-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.debug-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.debug-close:hover {
    color: var(--text-primary);
}

.debug-body {
    padding: 1.25rem;
}

.debug-info {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0 0 1rem;
    line-height: 1.5;
}

.debug-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-card);
    color: var(--text-primary);
}

.debug-btn:hover {
    background: var(--bg-card-hover);
}

.debug-btn.danger {
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.debug-btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.5);
}

.debug-stats {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.debug-stat {
    text-align: center;
}

.debug-stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

.debug-stat-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}
