
 /* Reset & base */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f6f8;
    color: #333;
}

/* Top bar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 10px 20px;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.topbar-left {
    display: flex;
    align-items: center;
}

.logo {
    height: 44px;
}

/* Navigation */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.topbar-right a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

.topbar-right a:hover {
    color: #0077cc;
}

.user-info {
    font-size: 0.9em;
    color: #666;
}

.logout {
    color: #cc0000;
}

/* Main content */
.content {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Utility */
h1, h2 {
    margin-top: 0;
}

/* Login */
.login-box {
    max-width: 360px;
    margin: 80px auto;
    padding: 24px;
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.login-box label {
    display: block;
    margin-top: 12px;
    font-weight: 500;
}

.login-box input {
    width: 100%;
    padding: 8px;
    margin-top: 4px;
}

.login-box input[type="submit"] {
    margin-top: 16px;
    background: #0077cc;
    color: #fff;
    border: none;
    padding: 10px;
    cursor: pointer;
}

.login-box input[type="submit"]:hover {
    background: #005fa3;
}

.error {
    margin-top: 12px;
    color: #cc0000;
}

.form-group {
    margin-bottom: 1.2rem;  /* increase vertical spacing */
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.5rem;
}

/* Table styling for admin user/device lists */
.admin-table {
    width: 100%;
    border-collapse: separate;  /* allows spacing between rows */
    border-spacing: 0 0.5rem;   /* vertical gap between rows */
}

.admin-table th,
.admin-table td {
    padding: 0.6rem 1rem;       /* vertical + horizontal padding */
    text-align: left;
    vertical-align: middle;
    background: #fff;
    border-bottom: 1px solid #ddd;
    border-radius: 4px;
}

.admin-table th {
    background: #f0f0f0;
    font-weight: 600;
}

.admin-table tr:hover td {
    background: #f9f9f9;
}

.admin-table .action-buttons button {
    margin-right: 0.5rem;       /* space between buttons */
}

/* style.css */

/* Admin page header with right-aligned button */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.admin-header h2 {
    margin: 0;
}

.admin-header .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

        #charts-container {
            display: flex;
            flex-direction: column;
            gap: 30px;
        }

        canvas {
            width: 100% !important;
            height: auto !important;
        }

        #powerChart {
            max-height: 300px;
        }

        #energyChart {
            max-height: 200px;
        }

        #controls {
            margin-bottom: 10px;
        }

