body, h1, h2, h3, p, div {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    width: 100%;
    transition: background-color 0.3s, color 0.3s;
}

header {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    width: 100%;
    background: linear-gradient(90deg, #4caf50, #2196f3);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1rem;
}

body.dark-mode {
    background-color: #121212;
    color: #ffffff;
}

header.dark-mode {
    background: linear-gradient(90deg, #2a2a2a, purple);
}

footer.dark-mode {
    color: #bbb;
}

.grid-item.dark-mode {
    background-color: #333;
    color: #fff;
}

.grid-item.dark-mode h3,
.grid-item.dark-mode button {
    color: #fff;
}

.accent-color {
    color: #e91e63;
}

button:hover, .grid-item button:hover {
    background-color: #9c27b0;
}

button.dark-mode:hover, .grid-item.dark-mode button:hover {
    background-color: #8e24aa;
}

button.dark-mode {
    background-color: #555;
    color: white;
}

button.dark-mode:hover {
    background-color: #444;
}

#dark-mode-toggle {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

#dark-mode-toggle:hover {
    color: #ccc;
}

#main-dashboard {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.grid-item {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s, color 0.3s;
}

.grid-item h3 {
    text-align: center;
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 15px;
}

.grid-item h3.accent-color {
    color: #e91e63;
}

.grid-item button {
    margin: 5px;
    padding: 8px 12px;
    background-color: #2196f3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.grid-item button:hover {
    background-color: #1976d2;
}

.grid-item.dark-mode button {
    background-color: #551054;
    color: white;
}

.grid-item.dark-mode button:hover {
    background-color: #2d102c;
}

.grid-item canvas {
    margin-top: 10px;
    max-width: 100%;
}

#main-dashboard div[id^="status-indicator-"] {
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .grid-item {
        padding: 10px;
    }
}

footer {
    margin-top: 30px;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

footer.dark-mode {
    color: #bbb;
}
