body {
    background: #f8f9fa;
}
* { box-sizing: border-box; }
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 2.5fr;
    gap: 32px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 0;
    min-height: 100vh;
}
#sidebar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    min-width: 0;
    max-width: 420px;
    padding-left: 0;
    font-size: 15px;
    color: #444;
}
#sidebar h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
    padding-left: 0;
}
.desc {
    margin-bottom: 10px;
    text-align: left;
    padding-left: 12px;
    /* Inherit font-size and weight from #sidebar */
}
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 18px 20px;
    margin-bottom: 18px;
    width: 100%;
    transition: box-shadow 0.2s;
}
.card.subtle {
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}
#controls {
    border: none;
    background: none;
    padding: 0;
    margin-bottom: 0;
    width: 100%;
}
#controls legend {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    padding: 0 4px;
}
.control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 4px;
    padding: 4px 6px;
}
.control:hover {
    background: #f0f4f8;
}
.control input[type="checkbox"] {
    accent-color: #2b8cbe;
    margin-right: 4px;
}
.label {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.95em;
    font-weight: 500;
    margin-right: 2px;
}
.label.moisture { background: #e3f2fd; color: #1565c0; }
.label.temp { background: #ffe0b2; color: #e65100; }
.label.humidity { background: #ede7f6; color: #512da8; }
.label.light { background: #fffde7; color: #fbc02d; }
.label.danger { background: #ffebee; color: #b71c1c; }
.sidebar-box {
    margin: 0 0 10px 0;
    padding: 8px 12px;
    border: none;
    background: none;
    /* Inherit font-size and color from #sidebar */
    width: 100%;
    border-radius: 6px;
}
#sidebar legend {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    padding: 0 4px;
}

#sidebar strong {
    font-size: 1.08rem;
    font-weight: 600;
}
.status-indicator {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    background: #eee;
    color: #444;
}
.status-indicator.danger {
    background: #ffebee;
    color: #b71c1c;
}
.status-indicator.safe {
    background: #e8f5e9;
    color: #388e3c;
}
main#chart-area.card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    min-width: 0;
    width: 100%;
    position: relative;
    padding: 18px 20px 0 20px;
}
.canvas-wrapper {
    width: 100%;
    min-width: 0;
    min-height: 400px;
    height: 60vh;
    position: relative;
}
#unifiedChart {
    width: 100% !important;
    height: 100% !important;
    display: block;
    position: absolute;
    left: 0;
    top: 0;
}
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        padding: 12px 0;
        gap: 18px;
    }
    #sidebar {
        max-width: 100vw;
        width: 100%;
        padding-left: 0;
    }
    main#chart-area.card {
        width: 100%;
        min-width: 0;
        height: 400px;
        padding: 10px 6px 0 6px;
    }
    .canvas-wrapper {
        width: 100%;
        height: 100%;
        margin: 0;
    }
    .control {
        font-size: 13px;
        margin-bottom: 6px;
    }
}
