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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    background-color: white;
    border-bottom: 1px solid #e1e8ed;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
}

.logo-text {
    color: #4A90E2;
    font-weight: 400;
}

.logo-text strong {
    color: #2c3e50;
    font-weight: 600;
}

nav {
    flex: 1;
    display: flex;
    gap: 0.5rem;
}

nav a {
    text-decoration: none;
    color: #666;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 0.95rem;
}

nav a.active,
nav a:hover {
    background-color: #f0f4f8;
    color: #333;
}

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

.user-email {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

.logout-btn {
    background: none;
    border: 1px solid #e74c3c;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #e74c3c;
    transition: all 0.2s;
}

.logout-btn:hover {
    background-color: #e74c3c;
    color: white;
}

.admin-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.admin-btn:hover {
    background-color: #f8f9fa;
    border-color: #ccc;
}

.admin-icon {
    font-size: 1rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Main Content */
main {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-weight: 600;
}

h2 {
    font-size: 1.2rem;
    color: #2c3e50;
    font-weight: 600;
}

/* Info Card */
.info-card {
    background: white;
    border-radius: 6px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem 1.5rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.info-label {
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
}

.info-value {
    font-size: 0.95rem;
    color: #2c3e50;
    font-weight: 600;
}

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

.time-filter {
    display: flex;
    gap: 10px;
    align-items: center;
}

.timezone-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
    transition: all 0.2s ease;
}

.timezone-btn:hover {
    background: #f8f9fa;
    border-color: #999;
}

.timezone-btn:active {
    background: #e9ecef;
}

.time-filter select {
    padding: 0.5rem 2rem 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    background: white;
    border-radius: 6px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

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

.chart-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
}

.chart-stat {
    font-size: 0.875rem;
    font-weight: 600;
    color: #666;
}

canvas {
    max-height: 200px;
    margin-bottom: 0.5rem;
}

.chart-legend {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.5rem;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1rem;
    font-size: 0.8rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    display: inline-block;
}

/* Status Bar */
.status-bar {
    background: white;
    border-radius: 6px;
    padding: 1rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-disconnected {
    color: #f44336;
    font-weight: 500;
    font-size: 0.9rem;
}

.status-connected {
    color: #4caf50;
    font-weight: 500;
    font-size: 0.9rem;
}

#last-update {
    color: #666;
    font-size: 0.85rem;
}

/* Footer */
footer {
    background: white;
    border-top: 1px solid #e1e8ed;
    padding: 1.5rem 2rem;
    margin-top: auto;
}

.footer-content {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: #666;
}

.language-select {
    border: none;
    background: none;
    color: #666;
    cursor: pointer;
    font-size: 0.875rem;
}

.footer-content a {
    color: #4A90E2;
    text-decoration: none;
}

.footer-content a:hover {
    text-decoration: underline;
}

.separator {
    color: #ddd;
}

.copyright {
    color: #999;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    header {
        flex-wrap: wrap;
        padding: 1rem;
    }
    
    main {
        padding: 1rem;
    }
    
    .footer-content {
        flex-wrap: wrap;
        font-size: 0.8rem;
    }
}
