body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#login-container, #dashboard-container {
    background-color: #fff;
    padding: 2em;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#login-container {
    width: 300px;
}

#dashboard-container {
    width: 80%;
    max-width: 900px;
    display: none; /* Hidden by default */
}

h1, h2 {
    text-align: center;
    color: #1c1e21;
}

input[type="text"], input[type="password"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 1em;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box; /* Important */
}

button {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 4px;
    background-color: #0d6efd;
    color: white;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #0b5ed7;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 1em;
    margin-bottom: 1em;
}

#logout-button {
    width: auto;
    padding: 8px 16px;
    background-color: #dc3545;
}

#logout-button:hover {
    background-color: #c82333;
}

#rpis-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5em;
    margin-bottom: 2em;
}

.rpi {
    background-color: #e9ecef;
    padding: 1em;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.rpi h3 {
    margin-top: 0;
    color: #0d6efd;
}

#devices-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5em;
}

.device {
    background-color: #f8f9fa;
    padding: 1.5em;
    border-radius: 6px;
    border: 1px solid #eee;
}

.device h3 {
    margin-top: 0;
}

.device-controls button {
    width: 48%;
    display: inline-block;
}

.error {
    color: #dc3545;
    text-align: center;
    margin-top: 1em;
}
