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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f4f5f7;
    color: #2c2c2c;
}

.navbar {
    background: #1a1a1a;
    color: #fff;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand { font-weight: 700; font-size: 1.2rem; color: #E8610A; }

.navbar-links { display: flex; gap: 16px; align-items: center; font-size: 0.9rem; }
.navbar-links a { color: #fff; text-decoration: none; }
.navbar-links a:hover { text-decoration: underline; }

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

.login-box, .form-box {
    max-width: 380px;
    margin: 80px auto;
    background: #fff;
    padding: 32px;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.login-box h1, .form-box h1 { color: #E8610A; margin-bottom: 4px; }
.subtitle { color: #888; margin-bottom: 24px; font-size: 0.9rem; }

form label { display: block; margin-top: 14px; margin-bottom: 4px; font-size: 0.85rem; color: #555; }
form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
}
form button {
    margin-top: 22px;
    width: 100%;
    padding: 11px;
    background: #E8610A;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
}
form button:hover { background: #d1560a; }

.error { color: #c0392b; font-size: 0.85rem; margin-bottom: 8px; }

.back-link { display: inline-block; margin-top: 18px; color: #888; font-size: 0.85rem; text-decoration: none; }
.back-link:hover { color: #E8610A; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.page-header h1 { color: #2c2c2c; }

.btn {
    background: #E8610A;
    color: #fff;
    padding: 9px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
}
.btn:hover { background: #d1560a; }

.empty-state { color: #888; padding: 40px 0; text-align: center; }

.sensor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}

.sensor-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.sensor-card-header { display: flex; justify-content: space-between; align-items: center; }
.sensor-card-header h2 { font-size: 1.1rem; }

.badge { font-size: 0.72rem; padding: 3px 9px; border-radius: 20px; font-weight: 600; }
.badge-on { background: #e5f6ec; color: #1e8a4c; }
.badge-off { background: #f5e5e5; color: #b03a3a; }

.sensor-location, .sensor-device-id { color: #888; font-size: 0.82rem; margin-top: 2px; }

.stat-row { display: flex; gap: 24px; margin: 16px 0; }
.stat-label { font-size: 0.72rem; color: #999; text-transform: uppercase; letter-spacing: 0.03em; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: #E8610A; }
.stat-value-small { font-size: 0.85rem; font-weight: 500; color: #555; }
