:root {
    --primary-gradient: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
    --primary-color: #56ab2f;
    --success-color: #4CAF50; /* A slightly more vibrant green for success */
    --danger-color: #e53935;
    --background-color: #f9faf8; /* A slightly greenish-white */
    --card-background: #FFFFFF;
    --text-color: #1a2e1a; /* Dark green-tinted black */
    --text-light: #556b55;
    --border-color: #e0e5e0;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
    --border-radius: 16px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.7;
}

header {
    background: var(--card-background);
    color: var(--text-color);
    text-align: center;
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
}

header h1 {
    font-weight: 700;
    font-size: 1.75rem;
    letter-spacing: -0.5px;
}

.container {
    max-width: 1000px;
    margin: 2.5rem auto;
    padding: 0 1.5rem;
    display: grid;
    gap: 2rem;
}

.card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid transparent;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.card h2 {
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card h2 .icon {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}


/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
}

.status-item {
    text-align: center;
    padding: 1rem;
    border-radius: 12px;
    background: var(--background-color);
    border: 1px solid var(--border-color);
}

.status-item .icon {
    width: 28px;
    height: 28px;
    margin-bottom: 0.75rem;
    color: var(--text-light);
}

.status-item h3 {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-item p {
    font-size: 1.25rem;
    font-weight: 600;
}

#motor-status.status-on {
    color: var(--success-color);
}

#motor-status.status-off {
    color: var(--danger-color);
}

/* Controls */
.motor-toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    padding: 2rem 0;
    background: var(--background-color);
    border-radius: 12px;
}

.motor-toggle-container p {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-color);
}

.switch {
    position: relative;
    display: inline-block;
    width: 70px;
    height: 40px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 40px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 32px;
    width: 32px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

input:checked + .slider {
    background-image: var(--primary-gradient);
}

input:checked + .slider:before {
    transform: translateX(30px);
}

/* Schedule Form */
#schedule-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(86, 171, 47, 0.2);
}

.duration-input {
    display: flex;
    gap: 0.75rem;
}

.duration-input input { flex: 3; }
.duration-input select { flex: 2; }

.btn {
    background-image: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.9rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    align-self: flex-start;
    transition: transform 0.2s, box-shadow 0.3s;
    box-shadow: 0 4px 15px rgba(86, 171, 47, 0.3);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(86, 171, 47, 0.4);
}

.btn:active {
    transform: translateY(0);
}

/* Notification */
.notification {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a2e1a;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s, transform 0.4s;
    z-index: 1000;
    font-weight: 500;
}

.notification.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -10px);
}

/* Responsive Design */
@media (min-width: 768px) {
    .container {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "dashboard dashboard"
            "controls schedule";
    }
    .dashboard { grid-area: dashboard; }
    .controls { grid-area: controls; }
    .schedule { grid-area: schedule; }
}

@media (max-width: 576px) {
    body {
        -webkit-tap-highlight-color: transparent;
    }
    .container {
        margin-top: 1.5rem;
        padding: 0 1rem;
        gap: 1.5rem;
    }
    .card {
        padding: 1.5rem;
    }
    header h1 {
        font-size: 1.5rem;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .btn {
        align-self: stretch;
        text-align: center;
    }
}
/* ... [KEEP ALL PREVIOUS CSS UNCHANGED] ... */

/* ADD THESE NEW STYLES AT THE END */

.health {
    grid-column: 1 / -1; /* Make it span full width if in grid */
}

.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.health-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--background-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.health-item span:first-child {
    font-weight: 600;
    color: var(--text-light);
}

.badge {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    text-transform: uppercase;
}

.status-ok {
    background-color: rgba(76, 175, 80, 0.15);
    color: var(--success-color);
}

.status-error {
    background-color: rgba(229, 57, 53, 0.15);
    color: var(--danger-color);
}