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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    text-align: center;
}

header h1 {
    color: #2d3748;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    color: #718096;
    font-size: 1.1rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.card.full-width {
    grid-column: 1 / -1;
}

.card h2 {
    color: #2d3748;
    font-size: 1.5rem;
    margin-bottom: 20px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    color: #4a5568;
    font-weight: 500;
}

.stat-value {
    color: #667eea;
    font-weight: 600;
    font-size: 1.1rem;
}

.uptime-display {
    text-align: center;
    padding: 30px;
    font-size: 1.3rem;
    color: #2d3748;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 8px;
    font-weight: 500;
}

.dispatcher-set {
    margin-bottom: 30px;
}

.dispatcher-set:last-child {
    margin-bottom: 0;
}

.dispatcher-set h3 {
    color: #2d3748;
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding: 10px;
    background: #f7fafc;
    border-left: 4px solid #667eea;
    border-radius: 4px;
}

.dispatcher-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.dispatcher-table thead {
    background: #667eea;
    color: white;
}

.dispatcher-table th,
.dispatcher-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.dispatcher-table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.dispatcher-table tbody tr:hover {
    background: #f7fafc;
}

.state-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.state-active {
    background: #c6f6d5;
    color: #22543d;
}

.state-inactive {
    background: #fed7d7;
    color: #742a2a;
}

.state-probing {
    background: #fef3c7;
    color: #78350f;
}

.state-early {
    background: #feebc8;
    color: #7c2d12;
}

.calls-summary {
    display: flex;
    justify-content: space-around;
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 20px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.summary-label {
    color: #4a5568;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    color: #667eea;
    font-weight: 700;
    font-size: 2rem;
}

.calls-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.calls-table thead {
    background: #667eea;
    color: white;
}

.calls-table th,
.calls-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.calls-table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.calls-table tbody tr:hover {
    background: #f7fafc;
}

.uri-cell {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.addr-cell {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #4a5568;
}

.loading,
.no-data,
.error {
    text-align: center;
    padding: 40px;
    color: #718096;
    font-style: italic;
}

.error {
    color: #e53e3e;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .dispatcher-table {
        font-size: 0.9rem;
    }
    
    .dispatcher-table th,
    .dispatcher-table td {
        padding: 8px;
    }
}
