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

:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --dark-color: #2c3e50;
    --light-bg: #ecf0f1;
    --white: #ffffff;
    --border-color: #bdc3c7;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--dark-color);
    line-height: 1.6;
}

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

header {
    background: linear-gradient(135deg, var(--primary-color), #2980b9);
    color: var(--white);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

header h1 {
    margin-bottom: 5px;
    font-size: 32px;
}

.subtitle {
    opacity: 0.9;
    font-size: 16px;
    margin-bottom: 15px;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

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

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-info {
    background-color: var(--warning-color);
    color: var(--white);
}

.last-update {
    margin-left: auto;
    font-size: 14px;
    opacity: 0.9;
}

.alerts-section {
    background-color: var(--danger-color);
    color: var(--white);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.alerts-section h2 {
    margin-bottom: 15px;
}

#alertsContainer {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert-item {
    background-color: rgba(255,255,255,0.2);
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid var(--white);
}

.stats-section {
    margin-bottom: 30px;
}

.stats-section h2 {
    margin-bottom: 20px;
    color: var(--dark-color);
}

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

.stat-card {
    background-color: var(--white);
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
}

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

.stat-icon {
    font-size: 40px;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: var(--dark-color);
}

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

.chart-container {
    background-color: var(--white);
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.chart-container h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
}

.tables-section {
    display: grid;
    gap: 20px;
}

.table-container {
    background-color: var(--white);
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

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

.table-container h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
}

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

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

thead {
    background-color: var(--primary-color);
    color: var(--white);
}

th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
    background-color: var(--light-bg);
}

.no-data {
    text-align: center;
    color: #95a5a6;
    font-style: italic;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status-completed {
    background-color: #d4edda;
    color: #155724;
}

.status-failed {
    background-color: #f8d7da;
    color: #721c24;
}

.status-active {
    background-color: #cce5ff;
    color: #004085;
}

.status-queued {
    background-color: #fff3cd;
    color: #856404;
}

.direction-inbound {
    color: var(--secondary-color);
    font-weight: 600;
}

.direction-outbound {
    color: var(--primary-color);
    font-weight: 600;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 24px;
    }
    
    .stat-value {
        font-size: 22px;
    }
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s infinite;
}
