/* =========================================================
   SMART POTISMA — SHARED THEME
   Κοινή εμφάνιση για όλες τις σελίδες
   ========================================================= */

:root {
    color-scheme: dark;
    --sp-bg: #07150d;
    --sp-panel: #0b1d12;
    --sp-panel-light: #10271a;
    --sp-panel-dark: #091b11;
    --sp-panel-hover: #193b26;
    --sp-border: #274834;
    --sp-border-light: #315b3c;
    --sp-text: #eef7ef;
    --sp-text-muted: #a9beb0;
    --sp-text-dim: #829888;
    --sp-green: #87e35d;
    --sp-green-light: #9ae878;
    --sp-green-dark: #193b26;
    --sp-blue: #54ddff;
    --sp-red: #ff6868;
    --sp-orange: #ffad4d;
    --sp-radius: 13px;
    --sp-radius-large: 18px;
    --sp-shadow: 0 18px 44px #0003;
}

/* BASE */
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--sp-bg); }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--sp-bg);
    color: var(--sp-text);
    font: 16px/1.5 Inter, Arial, sans-serif;
}
a { color: var(--sp-green-light); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
.wrap { width: min(1050px, 100% - 34px); margin: 0 auto; }
h2, h3 { color: var(--sp-text); }

/* HEADER / NAVIGATION */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid rgb(36, 69, 49);
}
.brand {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    height: auto;
    min-width: 0;
    margin-left: -50px;
}

.brand img {
    display: block;
    flex: 0 0 auto;
    width: 380px;
    height: auto;
    max-width: 100%;
    max-height: none;
    object-fit: contain;
}
.brand span { color: var(--sp-green-light); }
.top-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.top-actions a, .logout {
    display: inline-block;
    border: 0;
    border-radius: 9px;
    padding: 9px 12px;
    background: var(--sp-green-dark);
    color: rgb(233, 246, 232);
    text-decoration: none;
    font: 600 12px Inter, Arial, sans-serif;
}
.top-actions a:hover, .logout:hover { background: rgb(40, 85, 53); }
.logout { cursor: pointer; }
.logout-form { display: inline-flex; margin: 0; }
.welcome {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 12px;
    padding: 24px 0 18px;
}
.welcome h1 { margin: 0; font-size: clamp(26px, 4vw, 38px); letter-spacing: -.04em; }
.welcome p { margin: 4px 0 0; color: var(--sp-text-muted); }

/* PANELS / CARDS */
.panel {
    margin: 14px 0;
    padding: 19px;
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-large);
    background: linear-gradient(150deg, var(--sp-panel), var(--sp-panel-light));
    box-shadow: var(--sp-shadow);
}
.card {
    padding: 16px;
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    background: var(--sp-panel-dark);
}
.empty {
    padding: 18px;
    border: 1px solid var(--sp-border);
    border-radius: 12px;
    background: rgb(13, 33, 21);
    color: rgb(181, 200, 184);
}

/* MESSAGES */
.message, .alert-success {
    margin: 10px 0;
    padding: 12px;
    border: 1px solid rgb(55, 99, 69);
    border-radius: 11px;
    background: rgb(23, 59, 37);
    color: rgb(207, 242, 191);
}
.alert-error, .error {
    margin: 10px 0;
    padding: 12px;
    border: 1px solid rgb(112, 64, 56);
    border-radius: 11px;
    background: rgb(58, 33, 28);
    color: rgb(255, 194, 173);
}
.alert-warning {
    padding: 12px;
    border: 1px solid rgb(118, 85, 46);
    border-radius: 11px;
    background: rgb(57, 43, 24);
    color: rgb(255, 207, 141);
}
.panel .error, .panel .dashboard-error {
    margin: 12px 0;
    padding: 11px 13px;
    border: 1px solid rgba(255, 104, 104, .4);
    border-radius: 9px;
    background: rgba(255, 104, 104, .09);
    color: #ffaaaa;
}
.weather-update-error { margin-top: 8px; color: var(--sp-orange); font-size: 12px; }
.updated { margin-top: 12px; color: var(--sp-text-dim); font-size: 11px; text-align: right; }

/* FORMS / INPUTS */
form { min-width: 0; }
label { color: var(--sp-text-muted); }
input, select, textarea {
    width: 100%;
    min-width: 0;
    padding: 10px 11px;
    border: 1px solid rgb(66, 99, 75);
    border-radius: 8px;
    outline: none;
    background: var(--sp-bg);
    color: var(--sp-text);
}
input::placeholder, textarea::placeholder { color: rgb(130, 152, 136); opacity: 1; }
input:focus, select:focus, textarea:focus {
    border-color: var(--sp-green);
    box-shadow: rgba(135, 227, 93, .133) 0 0 0 2px;
}
input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--sp-green); }
input[type="date"], input[type="time"] { color-scheme: dark; }

/* BUTTONS */
button, .btn {
    display: inline-block;
    border: 0;
    border-radius: 9px;
    padding: 10px 14px;
    background: var(--sp-green-light);
    color: rgb(16, 35, 23);
    font-weight: 750;
    text-decoration: none;
    transition: background .15s, transform .15s;
}
button:hover, .btn:hover { background: var(--sp-green-light); }
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
.btn-secondary, button.secondary { background: rgb(25, 59, 38); color: var(--sp-text); }
.btn-secondary:hover, button.secondary:hover { background: rgb(40, 85, 53); }
.btn-danger, button.danger { background: rgb(169, 74, 66); color: #fff; }
.btn-danger:hover, button.danger:hover { background: rgb(196, 91, 80); }

/* TABLES / BADGES */
table { width: 100%; border-collapse: collapse; color: var(--sp-text); }
thead { background: rgb(20, 43, 27); }
th {
    padding: 12px;
    color: var(--sp-green-light);
    font-size: 12px;
    font-weight: 750;
    text-align: left;
    border-bottom: 1px solid var(--sp-border-light);
}
td { padding: 12px; border-bottom: 1px solid rgb(32, 59, 41); vertical-align: middle; }
tbody tr { background: transparent; }
tbody tr:hover { background: rgb(20, 43, 27); }
tbody tr:last-child td { border-bottom: 0; }
.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 20px;
    background: rgb(24, 59, 37);
    color: rgb(191, 241, 168);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.badge.inactive, .badge-danger { background: rgb(59, 36, 32); color: rgb(255, 194, 173); }
.badge-warning { background: rgb(57, 43, 24); color: rgb(255, 207, 141); }
.badge-info { background: rgb(18, 49, 58); color: var(--sp-blue); }

/* FOOTER / SEPARATORS */
hr {
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-image: none;
    border-top: 1px solid var(--sp-border);
    margin: 18px 0;
}
.foot { padding: 15px 0 28px; color: var(--sp-text-dim); font-size: 11px; }

/* DASHBOARD — DEVICE AND WEATHER */
.device-overview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 24px;
    padding: 15px 0 18px;
    border-bottom: 1px solid #274633;
    margin-bottom: 15px;
}
.weather-summary { display: flex; align-items: center; gap: 18px; min-width: 0; }
.weather-summary img {
    display: block;
    width: 140px;
    height: 140px;
    min-width: 140px;
    flex: 0 0 140px;
    object-fit: contain;
}
.weather-info { min-width: 0; }
.weather-info h2, .weather-info h3 { margin: 0 0 5px; }
.weather-info p { margin: 3px 0; color: var(--sp-text-muted); }
.device-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    background: var(--sp-panel-dark);
}
.device-meta > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.device-meta strong { color: var(--sp-text); }
.device-meta span { color: var(--sp-text-muted); }
.device-meta-name { color: var(--sp-green-light); font-size: 16px; font-weight: 750; }
.device-meta-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.device-meta-label { color: var(--sp-text-dim) !important; font-size: 11px; }
.device-meta-value { color: var(--sp-text) !important; font-size: 12px; text-align: right; overflow-wrap: anywhere; }
.device-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 9px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 750;
    white-space: nowrap;
}
.device-status.active { color: var(--sp-green-light); background: rgba(135, 227, 93, .12); }
.device-status.inactive { color: #ffaaaa; background: rgba(255, 104, 104, .12); }
.device-status .dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: currentColor; }

/* MEASUREMENTS — DHT11 */
.measurements {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0;
}
.measurement {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    background: var(--sp-panel-dark);
    text-align: center;
}
.measurement > span, .measurement .measurement-label, .measurement .label {
    display: block;
    margin-bottom: 5px;
    color: var(--sp-text-muted);
    font-size: 13px;
}
.measurement strong, .measurement .measurement-value, .measurement .value {
    display: block;
    font-family: "DSEG7", "DSEG7 Classic", monospace;
    font-size: clamp(27px, 4vw, 36px);
    font-weight: 700;
    line-height: 1.4;
    color: var(--sp-orange);
}
.measurement.temperature strong { color: var(--sp-orange); }
.measurement.humidity strong, .measurement .measurement-value.humidity-value, .measurement .value.humidity { color: var(--sp-blue); }
.measurement .measurement-value .unit, .measurement .value .unit {
    font-family: Inter, Arial, sans-serif;
    font-size: .55em;
    font-weight: 600;
}
.range-note { margin-top: 5px; color: var(--sp-text-dim); font-size: 11px; }
.temp-warning, .measurement .temperature-warning {
    display: block;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 173, 77, .4);
    border-radius: 9px;
    background: rgba(255, 173, 77, .09);
    color: var(--sp-orange);
    font-size: 13px;
}
.measurement .temperature-warning.cold {
    border-color: rgba(84, 221, 255, .4);
    background: rgba(84, 221, 255, .08);
    color: var(--sp-blue);
}
@font-face {
    font-family: "DSEG7";
    src: url("../fonts/DSEG7Classic-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* SCHEDULE — WATERING PROGRAM */
.schedule {
    margin-top: 15px;
    padding: 17px;
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    background: var(--sp-panel-dark);
}
.schedule-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 13px;
}
.schedule-head h2, .schedule-head h3 { margin: 0; }
.schedule-form {
    display: block;
    width: 100%;
    margin-top: 17px;
    padding-top: 15px;
    border-top: 1px solid var(--sp-border);
}
.schedule-settings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: 100%; }
.schedule-settings label { display: block; min-width: 0; margin-bottom: 6px; color: var(--sp-text-muted); font-size: 12px; }
.schedule-settings input, .schedule-settings select { width: 100%; min-width: 0; }
.schedule-save { margin-top: 14px; }
.schedule-form .schedule-save { display: inline-block; width: auto; min-width: 150px; height: auto; padding: 10px 22px; white-space: nowrap; }
.details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 13px; }
.detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--sp-border);
    border-radius: 9px;
    background: #0d2115;
}
.detail span { color: var(--sp-text-muted); font-size: 12px; }
.detail strong { color: var(--sp-text); text-align: right; overflow-wrap: anywhere; }
.schedule-form .details.last-watering { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 13px; }

/* PUMP STATUS — SHARED SWITCH */
.pump-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border: 1px solid var(--sp-border);
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
}
.pump-status::before { display: none; }
.pump-switch {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
    flex: 0 0 32px;
    border-radius: 20px;
    transition: background .2s;
}
.pump-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    transition: left .2s;
}
.pump-status.is-on { color: #87e35d; border-color: rgba(72, 184, 106, .65); background: rgba(72, 184, 106, .12); }
.pump-status.is-on .pump-switch { background: #48b86a; }
.pump-status.is-on .pump-switch::after { left: 17px; }
.pump-status.is-off { color: #ff7777; border-color: rgba(217, 87, 87, .65); background: rgba(217, 87, 87, .12); }
.pump-status.is-off .pump-switch { background: #d95757; }
.pump-status.is-off .pump-switch::after { left: 3px; }
.pump-status.is-unknown { color: #ffca75; border-color: rgba(181, 138, 67, .65); background: rgba(181, 138, 67, .12); }
.pump-status.is-unknown .pump-switch { background: #b58a43; }
.pump-status.is-unknown .pump-switch::after { left: 10px; }
.pump-status.is-pending { color: var(--sp-orange); border-color: rgba(255, 173, 77, .6); background: rgba(255, 173, 77, .12); }
.pump-status.is-pending .pump-switch { background: var(--sp-orange); animation: pump-pending .8s infinite alternate; }
.pump-status.is-pending .pump-switch::after { left: 10px; }
.pump-status-text { color: inherit; }
.pump-status.active { border-color: rgba(135, 227, 93, .5); color: var(--sp-green-light); }
.pump-status.active::before, .pump-status.inactive::before {
    display: inline-block;
    content: "";
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
}
.pump-status.active::before { background: var(--sp-green); box-shadow: 0 0 10px rgba(135, 227, 93, .7); animation: pump-pulse 1.4s infinite; }
.pump-status.inactive::before { background: #829888; }
@keyframes pump-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .45; transform: scale(.75); }
}
@keyframes pump-pending { from { opacity: .45; } to { opacity: 1; } }

/* NEXT WATERING */
.next {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 14px 0;
    padding: 13px;
    border: 1px solid var(--sp-border);
    border-radius: 10px;
    background: #10271a;
}
.next small { display: block; color: var(--sp-text-muted); font-size: 12px; margin-bottom: 3px; }
.next span { color: var(--sp-text-muted); font-size: 13px; }
.next strong { color: var(--sp-green-light); font-size: 19px; line-height: 1.2; }

/* MANUAL CONTROLS */
.pump-toggle { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
    padding: 15px;
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    background: var(--sp-panel-dark);
}
.controls button { flex: 0 0 auto; }
.controls button.stop { background: #a94442; color: #fff; }
.controls button.stop:hover { background: #c45b50; }
.manual-duration { display: flex; align-items: center; gap: 8px; width: auto; margin-left: auto; }
.manual-duration label { white-space: nowrap; font-size: 12px; }
.manual-duration select, .manual-duration input { width: 90px; }

/* DEVICE PICKER */
.device-picker {
    display: block;
    width: 100%;
    margin: 20px 0;
    padding: 16px;
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    background: var(--sp-panel);
}
.device-picker h2 { margin: 0 0 14px; color: var(--sp-text); font-size: 17px; }
.device-picker ul { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; padding: 0; list-style: none; }
.device-picker li { flex: 1 1 150px; min-width: 0; }
.device-picker a {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-height: 65px;
    padding: 13px 15px;
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    background: var(--sp-panel-dark);
    color: var(--sp-text);
    text-decoration: none;
    transition: border-color .2s, background .2s;
}
.device-picker a:hover { border-color: var(--sp-green-light); background: var(--sp-panel-hover); }
.device-picker a.selected { border-color: var(--sp-green-light); background: rgba(66, 125, 75, .2); }
.device-picker-owner { color: var(--sp-text-muted); font-size: 11px; }

/* HISTORY / CHART */
.history-chart {
    min-width: 0;
    margin-top: 17px;
    padding: 15px;
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius);
    background: var(--sp-panel-dark);
}
.history-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.history-heading h2, .history-heading h3 { margin: 0; }
.history-heading strong { color: var(--sp-text); }
.history-heading > span { color: var(--sp-text-muted); font-size: 11px; }
.history-weather {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
    margin-bottom: 13px;
}
.history-weather-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.history-weather-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.history-weather-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.history-weather-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.history-weather-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.history-weather-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.history-weather-cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.history-weather > div, .history-weather > span {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    padding: 8px 3px;
    border: 1px solid var(--sp-border);
    border-radius: 8px;
    background: #0d2115;
    text-align: center;
}
.history-weather span { color: var(--sp-text-muted); font-size: 10px; }
.history-weather strong { font-size: 12px; }
.history-weather img { display: block; width: 32px; height: 32px; object-fit: contain; }
.history-weather .no-icon { display: none; }
.history-canvas-wrap { position: relative; width: 100%; height: 240px; min-width: 0; }
.history-canvas { display: block; width: 100% !important; height: 100% !important; }
.history-empty { padding: 20px 10px; color: var(--sp-text-muted); text-align: center; font-size: 13px; }
.history-legend { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 12px; color: var(--sp-text-muted); font-size: 11px; }
.history-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-mark { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--sp-green); }
.legend-mark.low::before { background: #ff6868; }
.legend-mark.normal::before { background: #91e765; }
.legend-mark.high::before { background: #ffad4d; }
.legend-mark.low, .legend-mark.normal, .legend-mark.high { background: transparent; }
.legend-mark.low::before, .legend-mark.normal::before, .legend-mark.high::before {
    content: "";
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
}
.legend-mark.temperature { background: var(--sp-orange); }
.legend-mark.humidity { width: 14px; height: 2px; border-radius: 0; background: var(--sp-blue); }
.legend-mark.watering { background: var(--sp-green); }

/* FROST PROTECTION */
.frost-status {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-top: 14px;
    padding: 13px;
    border: 1px solid var(--sp-border);
    border-radius: 10px;
    background: #10271a;
    color: var(--sp-text-muted);
    font-size: 13px;
}
.frost-status.active, .frost-status.is-locked {
    border-color: rgba(84, 221, 255, .5);
    background: rgba(84, 221, 255, .09);
    color: #a9eaff;
}
.frost-status.warning, .frost-status.is-recovery {
    border-color: rgba(255, 173, 77, .5);
    background: rgba(255, 173, 77, .09);
    color: #ffd09b;
}
.frost-status strong { color: var(--sp-text); }

/* COMMAND FEEDBACK */
.watering-command-feedback {
    margin-top: 12px;
    padding: 11px 13px;
    border: 1px solid var(--sp-border);
    border-radius: 9px;
    background: #10271a;
    color: var(--sp-text-muted);
    font-size: 12px;
}
.watering-command-feedback:empty { display: none; }
.watering-command-feedback.success { border-color: rgba(135, 227, 93, .4); color: var(--sp-green-light); }
.watering-command-feedback.error { border-color: rgba(255, 104, 104, .4); color: #ffaaaa; }

/* =========================================================
   HOME PAGE — INDEX.PHP
   Οι κανόνες είναι scoped ώστε να μην επηρεάζουν το dashboard.
   ========================================================= */
.sp-home .hero { padding: 24px 0 12px; }
.sp-home .hero-photo { margin: 0; border-radius: 20px; overflow: hidden; background: #142d1d; }
.sp-home .hero-photo img { width: 100%; height: auto; max-height: none; object-fit: contain; object-position: center; display: block; }
.sp-home .section { padding: 28px 0; }
.sp-home .section-title { font-size: 24px; letter-spacing: -.035em; margin: 0 0 15px; }
.sp-home .device-overview {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 1fr);
    gap: 24px;
    padding: 18px 0 20px;
    margin-bottom: 18px;
}
.sp-home .weather-summary { gap: 18px; }
.sp-home .weather-summary img {
    width: 104px;
    height: 104px;
    min-width: 0;
    flex: 0 0 104px;
    object-fit: contain;
    filter: drop-shadow(0 7px 14px #72c4ff20);
}
.sp-home .weather-info strong { display: block; font-size: 19px; line-height: 1.35; color: var(--sp-text); }
.sp-home .weather-info small { display: block; margin-top: 5px; color: #adc2b1; font-size: 12px; line-height: 1.5; }
.sp-home .weather-info .weather-update-error { color: #ff9b8e; }
.sp-home .device-meta {
    display: grid;
    gap: 10px;
    background: #091b11;
    border: 1px solid #284633;
    border-radius: 14px;
    padding: 15px 17px;
}
.sp-home .device-meta-name { font-size: 19px; font-weight: 800; color: #e5f2e7; overflow-wrap: anywhere; }
.sp-home .device-meta-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sp-home .device-meta-label { color: #91a997 !important; font-size: 13px; }
.sp-home .device-meta-value { color: #e0ebe2 !important; font-weight: 650; font-size: 13px; text-align: right; overflow-wrap: anywhere; }
.sp-home .device-status { padding: 6px 10px; font-size: 11px; }
.sp-home .device-status.active { background: #183b25; color: #bff1a8; }
.sp-home .device-status.inactive { background: #42251f; color: #ffb4a8; }
.sp-home .device-status .dot { background: #91e765; box-shadow: 0 0 8px #91e76588; }
.sp-home .device-status.inactive .dot { background: #ff7868; box-shadow: 0 0 8px #ff786888; }
.sp-home .measurements { gap: 13px; margin: 0; }
.sp-home .measurement { background: #091b11; border-color: #284633; border-radius: 14px; padding: 15px; }
.sp-home .measurement > .label { width: 100%; color: #abc0ae; font-size: 13px; font-weight: 700; text-align: center; margin-bottom: 8px; }
.sp-home .measurement > .value {
    display: inline-block;
    white-space: nowrap;
    font-family: "DSEG7 Classic", "DSEG7", "Courier New", monospace;
    font-size: clamp(20px, 3.5vw, 42px);
    font-weight: 400;
    font-synthesis: none;
    line-height: 1.2;
    letter-spacing: .02em;
    font-variant-numeric: tabular-nums;
}
.sp-home .value.temp-normal { color: #91f66a; text-shadow: 0 0 14px #91f66a55; }
.sp-home .value.temp-high { color: #ffad4d; text-shadow: 0 0 14px #ffad4d55; }
.sp-home .value.temp-low { color: #ff6868; text-shadow: 0 0 14px #ff686855; }
.sp-home .value.temp-neutral { color: #d7e5da; }
.sp-home .value.humidity { color: #54ddff; text-shadow: 0 0 14px #54ddff55; }
.sp-home .measurement .unit { font: 600 clamp(11px, 1.4vw, 16px)/1 Inter, Arial, sans-serif; letter-spacing: 0; }
.sp-home .source { display: block; color: #84998a; font-size: 11px; margin-top: 7px; }
.sp-home .temperature-warning { display: block; margin-top: 7px; color: #ffad4d; font-size: 12px; font-weight: 700; }
.sp-home .temperature-warning.cold { color: #ff6868; }
.sp-home .history-chart { margin-top: 14px; background: #091b11; border-color: #274633; border-radius: 12px; padding: 14px; }
.sp-home .history-heading { align-items: baseline; margin-bottom: 8px; }
.sp-home .history-heading strong { font-size: 14px; }
.sp-home .history-heading > span { font-size: 10px; color: #829888; }
.sp-home .history-weather { align-items: center; text-align: center; margin: 0 0 2px; color: #829888; font-size: 10px; gap: 0; }
.sp-home .history-weather > div { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; padding: 0; border: 0; border-radius: 0; background: transparent; text-align: center; }
.sp-home .history-weather .no-icon { display: none; }
.sp-home .history-weather > div > span { color: #829888; font-size: 10px; }
.sp-home .history-canvas-wrap { height: auto; min-height: 0; aspect-ratio: 2.75 / 1; max-height: 14rem; overflow: hidden; }
.sp-home .history-empty { padding: 20px 8px; text-align: center; color: #a9beb0; font-size: 12px; }
.sp-home .history-legend { justify-content: flex-start; font-size: 10px; color: #829888; margin-top: 5px; gap: 12px; }
.sp-home .history-legend span { gap: 5px; }
.sp-home .legend-mark { width: 8px; height: 8px; border-radius: 2px; }
.sp-home .legend-mark.low::before, .sp-home .legend-mark.normal::before, .sp-home .legend-mark.high::before { width: 8px; height: 8px; border-radius: 2px; }
.sp-home .legend-mark.humidity { width: 14px; height: 2px; border-radius: 0; }
.sp-home .schedule {
    margin-top: 16px;
    background: linear-gradient(135deg, #122d1c, #183821);
    border-color: #315b3c;
    border-radius: 14px;
    padding: 16px;
}
.sp-home .schedule-head { gap: 10px; flex-wrap: nowrap; font-weight: 750; margin-bottom: 12px; }
.sp-home .pump-status {
    justify-content: center;
    gap: 9px;
    flex: 0 0 auto;
    min-width: 76px;
    padding: 6px 10px;
    border-color: transparent;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}
.sp-home .pump-status::before { display: none; content: none; }
.sp-home .pump-switch { width: 32px; min-width: 32px; height: 18px; flex: 0 0 32px; padding: 0; margin: 0; border: 0; }
.sp-home .pump-switch::after { display: block; top: 3px; left: 3px; width: 12px; height: 12px; border: 0; }
.sp-home .pump-status.is-on { color: #9ae878; border-color: #48b86a; background: rgba(72,184,106,.13); }
.sp-home .pump-status.is-on .pump-switch { background: #48b86a; }
.sp-home .pump-status.is-on .pump-switch::after { left: 17px; }
.sp-home .pump-status.is-off { color: #ff8585; border-color: #d95757; background: rgba(217,87,87,.13); }
.sp-home .pump-status.is-off .pump-switch { background: #d95757; }
.sp-home .pump-status.is-off .pump-switch::after { left: 3px; }
.sp-home .pump-status.is-unknown { color: #ffca75; border-color: #b58a43; background: rgba(181,138,67,.13); }
.sp-home .pump-status.is-unknown .pump-switch { background: #b58a43; }
.sp-home .pump-status.is-unknown .pump-switch::after { left: 10px; }
.sp-home .pump-status-text { display: inline-block; color: inherit; font-weight: 800; }
.sp-home .next { align-items: center; justify-content: space-between; background: #091b11; border-color: #315b3c; border-radius: 11px; padding: 13px; margin: 0; }
.sp-home .next small { color: #adc2b1; font-size: 12px; margin-bottom: 3px; }
.sp-home .next strong { color: var(--sp-text); font-size: 22px; }
.sp-home .next span { color: #b9f2a1; font-size: 13px; text-align: right; }
.sp-home .schedule-details { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
.sp-home .schedule-item { background: #091b11; border: 1px solid #274633; border-radius: 10px; padding: 11px; }
.sp-home .schedule-item small { display: block; color: #a9beb0; font-size: 12px; margin-bottom: 5px; }
.sp-home .schedule-item strong { font-size: 16px; }
.sp-home .updated, .sp-home .notice { font-size: 12px; color: #9bb09f; margin: 12px 0 0; }
.sp-home .notice.error { color: #ffb4a8; }
.sp-home .features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sp-home .feature { background: #0d2115; border: 1px solid #274633; border-radius: 14px; padding: 16px; }
.sp-home .feature h3 { font-size: 15px; margin: 0 0 6px; }
.sp-home .feature p { font-size: 13px; color: #a9beb0; margin: 0; }
.sp-home .limit { margin-top: 12px; border-left: 3px solid #ffad4d; padding: 9px 12px; color: #becdc1; font-size: 13px; }
.sp-home .footer { padding: 25px 0 32px; color: #829888; font-size: 12px; border-top: 1px solid #244531; margin-top: 18px; }
.sp-home .topbar { flex-wrap: nowrap; gap: 10px; }
.sp-home .topbar .brand { flex: 1 1 auto; min-width: 0; }
.sp-home .topbar a.login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: auto;
    margin-left: auto;
    padding: 11px 22px;
    background: linear-gradient(135deg, #27804d, #35a65f);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 750;
    border: 1px solid #55bd78;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(39, 128, 77, .25);
    white-space: nowrap;
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.sp-home .topbar a.login:hover {
    background: linear-gradient(135deg, #35a65f, #45bd70);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(39, 128, 77, .35);
}
.sp-home .topbar a.login:focus-visible { outline: 3px solid #91e765; outline-offset: 3px; }

/* RESPONSIVE */
@media (max-width: 700px) {
    .wrap { width: calc(100% - 22px); }
    .topbar { padding: 12px 0; align-items: center; }
    .brand { gap: 7px; font-size: 17px; }
    .top-actions { gap: 5px; }
    .top-actions a, .logout { padding: 8px 9px; font-size: 11px; }
    .panel { padding: 14px; }
    .welcome { padding-top: 19px; }
    table { display: block; overflow-x: auto; white-space: nowrap; }
    th, td { padding: 10px; }
    .device-overview { gap: 15px; }
    .weather-summary { gap: 12px; }
    .weather-summary img { width: 115px; height: 115px; min-width: 115px; flex-basis: 115px; }
    .history-canvas-wrap { height: 210px; }
}
@media (max-width: 650px) {
    .device-overview { grid-template-columns: 1fr; gap: 16px; padding: 13px 0 16px; }
    .weather-summary { justify-content: flex-start; }

    .device-meta { width: 100%; }
    .measurements { gap: 8px; }
    .measurement { padding: 12px 7px; }
    .schedule { padding: 13px; }
    .details { grid-template-columns: 1fr; gap: 6px; }
    .next { align-items: stretch; flex-direction: column; }
    .next strong { font-size: 17px; }
    .schedule-settings { grid-template-columns: 1fr; }
    .schedule-form .schedule-save { width: 100%; }
    .schedule-form .details.last-watering { grid-template-columns: 1fr; }
    .manual-duration { flex: 1 0 100%; margin-left: 0; }
    .controls button { padding: 10px 7px; }
    .history-chart { padding: 10px; }
    .history-weather img { width: 25px; height: 25px; }
    .history-weather span { font-size: 9px; }
    .history-canvas-wrap { height: 190px; }
    .device-picker li { flex-basis: 100%; }

    .sp-home .hero { padding-top: 16px; }
    .sp-home .device-overview { grid-template-columns: 1fr; gap: 15px; padding: 14px 0 17px; }
    .sp-home .weather-summary { gap: 13px; }
    .sp-home .weather-summary img { width: 82px; height: 82px; flex-basis: 82px; min-width: 82px; }
    .sp-home .weather-info strong { font-size: 17px; }
    .sp-home .device-meta { padding: 13px; }
    .sp-home .device-meta-name { font-size: 17px; }
    .sp-home .measurements { gap: 8px; }
    .sp-home .measurement { padding: 10px; }
    .sp-home .measurement > .label { font-size: 12px; }
    .sp-home .schedule-details { gap: 7px; }
    .sp-home .features { grid-template-columns: 1fr; }
    .sp-home .next { align-items: flex-start; flex-direction: column; }
    .sp-home .next strong { font-size: 19px; }
    .sp-home .next span { text-align: left; }
    .sp-home .history-chart { padding: 10px; }
    .sp-home .pump-status { gap: 7px; padding: 6px 8px; }
    .sp-home .topbar { flex-wrap: nowrap; padding-top: 12px; padding-bottom: 12px; }
    .sp-home .topbar .brand { flex: 1 1 auto; min-width: 0; }
    .sp-home .topbar .brand img { flex-shrink: 0; }
    .sp-home .topbar a.login { display: inline-flex; flex: 0 0 auto; width: auto; padding: 8px 13px; font-size: 12px; border-radius: 8px; margin-left: auto; }
}
@media (max-width: 420px) {
    .topbar { align-items: flex-start; flex-direction: column; }
    .top-actions { width: 100%; }
    .top-actions a, .logout { text-align: center; }
    .weather-summary img { width: 100px; height: 100px; min-width: 100px; flex-basis: 100px; }
    .measurement strong { font-size: 25px; }
    .history-weather { gap: 3px; }
    .history-weather > div, .history-weather > span { padding: 6px 2px; }
    .history-weather img { width: 20px; height: 20px; }
    .history-legend { gap: 8px; font-size: 10px; }

    .sp-home .topbar { align-items: center; flex-direction: row; }
    .sp-home .topbar .brand { flex: 1 1 auto; min-width: 0; }
    .sp-home .topbar a.login { padding: 8px 13px; font-size: 12px; }
}


/* =========================================================
   SMART POTISMA — DASHBOARD PAGE OVERRIDES
   Extracted from dashboard.php; scoped to dashboard only.
   ========================================================= */

body.dashboard-page .device-overview{
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    align-items:center;
    gap:24px;
    padding:15px 0 18px;
    border-bottom:1px solid #274633;
    margin-bottom:15px
}
body.dashboard-page .weather-summary{
    display:flex;
    align-items:center;
    gap:14px;
    min-width:0
}
body.dashboard-page .weather-summary img{
    width:82px;
    height:82px;
    flex:none;
    object-fit:contain
}
body.dashboard-page .weather-info{min-width:0}
body.dashboard-page .weather-info strong{
    display:block;
    font-size:17px;
    line-height:1.35
}
body.dashboard-page .weather-info small{
    display:block;
    color:#a9beb0;
    font-size:12px;
    line-height:1.5;
    margin-top:4px
}
body.dashboard-page .device-meta{
    min-width:0;
    display:flex;
    flex-direction:column;
    gap:9px
}
body.dashboard-page .device-meta-name{
    color:#eff8ef;
    font-size:19px;
    font-weight:800;
    line-height:1.3;
    overflow-wrap:anywhere;
    margin-bottom:2px
}
body.dashboard-page .device-meta-row{
    display:grid;
    grid-template-columns:minmax(90px,auto) minmax(0,1fr);
    align-items:center;
    gap:10px;
    font-size:12px
}
body.dashboard-page .device-meta-label{color:#829888}
body.dashboard-page .device-meta-value{
    color:#dceade;
    font-weight:600;
    overflow-wrap:anywhere;
    text-align:right
}
body.dashboard-page .device-status{
    display:inline-flex;
    justify-content:flex-end;
    align-items:center;
    gap:7px;
    font-size:11px;
    font-weight:800;
    letter-spacing:.04em
}
body.dashboard-page .device-status.active{color:#9ae878;background:transparent}
body.dashboard-page .device-status.inactive{color:#ff8880;background:transparent}
body.dashboard-page .device-status .dot{
    width:8px;
    height:8px;
    border-radius:50%;
    background:currentColor;
    flex:none
}
body.dashboard-page .measurements{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px
}
body.dashboard-page .measurement{
    background:#091b11;
    border:1px solid #284633;
    border-radius:13px;
    padding:13px;
    text-align:center
}
body.dashboard-page .measurement-label{
    display:block;
    width:100%;
    font-weight:700;
    text-align:center;
    color:#abc0ae;
    font-size:12px;
    margin-bottom:7px
}
body.dashboard-page .measurement-value{
    display:inline-block;
    white-space:nowrap;
    font-family:"DSEG7 Classic","Courier New",monospace;
    font-size:clamp(20px,3vw,32px);
    line-height:1.2;
    letter-spacing:.02em;
    font-weight:400;
    font-synthesis:none
}
body.dashboard-page .temp-normal{color:#91f66a;text-shadow:0 0 12px #91f66a55}
body.dashboard-page .temp-high{color:#ffad4d;text-shadow:0 0 12px #ffad4d55}
body.dashboard-page .temp-low{color:#ff6868;text-shadow:0 0 12px #ff686855}
body.dashboard-page .temp-neutral{color:#d7e5da}
body.dashboard-page .humidity-value{color:#54ddff;text-shadow:0 0 12px #54ddff55}
body.dashboard-page .unit{font:600 13px Inter,Arial,sans-serif;letter-spacing:0}
body.dashboard-page .range-note{font-size:10px;color:#9fb4a2;margin:8px 2px 0}
body.dashboard-page .temp-warning{
    display:block;
    margin-top:6px;
    color:#ffad4d;
    font-size:11px;
    line-height:1.4;
    font-weight:700
}
body.dashboard-page .temp-warning.cold{color:#ff6868}
body.dashboard-page .schedule{
    margin-top:13px;
    background:linear-gradient(135deg,#122d1c,#183821);
    border:1px solid #315b3c;
    border-radius:13px;
    padding:13px
}
body.dashboard-page .schedule-head{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    font-weight:750;
    font-size:14px;
    margin-bottom:9px
}
body.dashboard-page .pump-status{
    display:inline-flex;
    align-items:center;
    gap:7px;
    font-size:11px;
    font-weight:700;
    white-space:nowrap
}
body.dashboard-page .pump-status.is-on{color:#9ae878}
body.dashboard-page .pump-status.is-off{color:#ff6868}
body.dashboard-page .pump-status.is-unknown{color:#a9beb0}
body.dashboard-page .pump-status-text{font-size:11px}
body.dashboard-page .pump-toggle{
    display:inline-block;
    position:relative;
    width:32px;
    height:18px;
    border-radius:10px;
    background:#a83232;
    flex:none
}
body.dashboard-page .pump-toggle:after{
    content:"";
    position:absolute;
    left:2px;
    top:2px;
    width:14px;
    height:14px;
    border-radius:50%;
    background:#fff;
    transition:transform .15s ease
}
body.dashboard-page .pump-status.is-on .pump-toggle{background:#338a43}
body.dashboard-page .pump-status.is-on .pump-toggle:after{transform:translateX(14px)}
body.dashboard-page .pump-status.is-unknown .pump-toggle{background:#53645a}
body.dashboard-page .pump-status.is-pending .pump-toggle{
    background:#b18b35;
    animation:pump-pending 1s ease-in-out infinite alternate
}
@keyframes pump-pending{
    from{opacity:.45}
    to{opacity:1}
}
body.dashboard-page .next{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    background:#091b11;
    border:1px solid #315b3c;
    border-radius:10px;
    padding:11px
}
body.dashboard-page .next small{
    display:block;
    color:#a9beb0;
    font-size:10px;
    margin-bottom:3px
}
body.dashboard-page .next strong{font-size:19px}
body.dashboard-page .details{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
    margin-top:8px
}
body.dashboard-page .detail{
    background:#091b11;
    border:1px solid #274633;
    border-radius:9px;
    padding:10px
}
body.dashboard-page .detail small{
    display:block;
    color:#a9beb0;
    font-size:10px;
    margin-bottom:4px
}
body.dashboard-page .detail strong{font-size:14px}
body.dashboard-page .last-watering{grid-template-columns:1fr}
body.dashboard-page .schedule-form{margin:0}
body.dashboard-page .schedule-settings{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:8px;
    margin-top:8px
}
body.dashboard-page .schedule-settings label{
    display:flex;
    min-width:0;
    flex-direction:column;
    gap:3px;
    color:#a9beb0;
    font-size:10px
}
body.dashboard-page .schedule-settings input{
    width:100%;
    min-width:0;
    padding:7px 8px;
    background:#07150d;
    color:#b9f2a1;
    border:1px solid #42634b;
    border-radius:8px;
    font:600 13px Arial,sans-serif
}
body.dashboard-page .schedule-save{
    margin-top:9px;
    border:0;border-radius:8px;
    padding:9px 13px;
    background:#87e35d;
    color:#102317;
    font-weight:750;
    cursor:pointer
}
body.dashboard-page .controls{
    display:flex;
    align-items:end;
    flex-wrap:wrap;
    gap:9px;
    margin-top:12px
}
body.dashboard-page .manual-duration{
    display:flex;
    flex-direction:column;
    gap:4px;
    min-width:140px;
    color:#a9beb0;
    font-size:10px
}
body.dashboard-page .manual-duration input{
    width:100%;
    padding:9px 8px;
    background:#07150d;
    color:#b9f2a1;
    border:1px solid #42634b;
    border-radius:8px;
    font:600 13px Arial,sans-serif
}
body.dashboard-page .controls button{
    flex:1;
    min-height:38px;
    border:0;
    border-radius:9px;
    padding:11px 12px;
    font-weight:700;
    font-size:12px;
    color:#102317;
    background:#87e35d;
    cursor:pointer
}
body.dashboard-page .controls button.stop{background:#a94a42;color:#fff}
body.dashboard-page .controls button:disabled{opacity:.45;cursor:not-allowed}
body.dashboard-page .error{
    margin-top:10px;
    padding:11px;
    border-radius:10px;
    background:#3a211c;
    color:#ffc2ad;
    font-size:12px
}
body.dashboard-page .updated{font-size:10px;color:#829888;margin:9px 2px 0}
body.dashboard-page .device-picker{
    margin:18px 0 28px;
    padding:14px;
    background:#0b1d12;
    border:1px solid #274834;
    border-radius:13px
}
body.dashboard-page .device-picker h2{font-size:14px;margin:0 0 8px}
body.dashboard-page .device-picker ul{
    list-style:none;
    margin:0;
    padding:0;
    display:grid;
    gap:6px
}
body.dashboard-page .device-picker a{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    padding:10px 12px;
    border:1px solid #274633;
    border-radius:9px;
    background:#091b11;
    color:#eef7ef;
    text-decoration:none
}
body.dashboard-page .device-picker a:hover,
body.dashboard-page .device-picker a.selected{
    border-color:#71aa62;
    background:#142b1b
}
body.dashboard-page .device-picker-owner{
    color:#a9beb0;
    font-size:12px;
    text-align:right
}
body.dashboard-page .history-chart{
    margin-top:14px;
    background:#091b11;
    border:1px solid #274633;
    border-radius:12px;
    padding:13px
}
body.dashboard-page .history-heading{
    display:flex;
    justify-content:space-between;
    align-items:baseline;
    gap:8px;
    margin-bottom:8px
}
body.dashboard-page .history-heading strong{font-size:14px}
body.dashboard-page .history-heading span{font-size:10px;color:#829888}
body.dashboard-page .history-weather{
    display:grid;
    grid-template-columns:repeat(7,minmax(0,1fr));
    align-items:center;
    text-align:center;
    margin:0 0 2px;
    color:#829888;
    font-size:10px
}
body.dashboard-page .history-weather img{
    display:block;
    width:24px;
    height:24px;
    object-fit:contain;
    margin:0 auto 2px
}
body.dashboard-page .history-weather .no-icon{height:26px}
body.dashboard-page .history-canvas-wrap{
    position:relative;
    width:100%;
    height:auto!important;
    min-height:0;
    aspect-ratio:2.75 / 1;
    max-height:14rem;
    overflow:hidden
}
body.dashboard-page .history-canvas{
    position:absolute;
    inset:0;
    display:block;
    width:100%!important;
    height:100%!important
}
body.dashboard-page .history-empty{
    padding:20px 8px;
    text-align:center;
    color:#a9beb0;
    font-size:12px
}
body.dashboard-page .history-legend{
    font-size:10px;
    color:#829888;
    margin-top:5px;
    display:flex;
    gap:12px;
    flex-wrap:wrap
}
body.dashboard-page .history-legend span{display:inline-flex;align-items:center;gap:5px}
body.dashboard-page .legend-mark{width:8px;height:8px;border-radius:2px}
body.dashboard-page .legend-mark.low{background:#ff6868}
body.dashboard-page .legend-mark.normal{background:#91e765}
body.dashboard-page .legend-mark.high{background:#ffad4d}
body.dashboard-page .legend-mark.humidity{
    width:14px;
    height:2px;
    border-radius:0;
    background:#54ddff
}
body.dashboard-page .foot{padding:15px 0 28px;color:#829888;font-size:11px}

@media(max-width:650px){
    body.dashboard-page .device-overview{
        grid-template-columns:1fr;
        gap:16px;
        padding:13px 0 16px
    }
    body.dashboard-page .weather-summary img{width:76px;height:76px}
    body.dashboard-page .device-meta{gap:8px}
    body.dashboard-page .device-meta-name{font-size:18px}
    body.dashboard-page .device-meta-row{grid-template-columns:110px minmax(0,1fr)}
    body.dashboard-page .measurements{gap:7px}
    body.dashboard-page .measurement{padding:10px}
    body.dashboard-page .details{gap:6px}
    body.dashboard-page .next{align-items:stretch;flex-direction:column}
    body.dashboard-page .next strong{font-size:17px}
    body.dashboard-page .schedule-settings{grid-template-columns:1fr}
    body.dashboard-page .manual-duration{flex:1 0 100%}
    body.dashboard-page .controls button{padding:10px 7px}
    body.dashboard-page .history-chart{padding:10px}
    body.dashboard-page .history-weather img{width:20px;height:20px}
}

body.dashboard-page .weather-update-error { color: #dc3545; }

/* Smart Potisma dashboard: clean schedule layout */

body.dashboard-page .schedule-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 12px;
    row-gap: 0;
    align-items: center;
}

/* Next watering: remove the separate card/background */
body.dashboard-page .schedule-form > .next {
    grid-column: 1 / -1;
    grid-row: 1;
    display: block;
    margin: 8px 0 12px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

body.dashboard-page .schedule-form > .next small {
    display: block;
    margin-bottom: 4px;
}

body.dashboard-page .schedule-form > .next strong {
    font-size: 19px;
}

/* Schedule fields occupy the full row */
body.dashboard-page .schedule-form > .schedule-settings {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
}

/* Save button bottom-left */
body.dashboard-page .schedule-form > .schedule-save {
    grid-column: 1;
    grid-row: 3;
    justify-self: start;
    align-self: center;
    width: auto;
    margin-top: 8px;
}

/* Last watering bottom-right */
body.dashboard-page .schedule-form > .last-watering {
    grid-column: 2;
    grid-row: 3;
    justify-self: end;
    width: 100%;
    margin-left: auto;
    margin-top: 8px;
    text-align: right;
}

body.dashboard-page .schedule-form > .last-watering .detail {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 100%;
}

/* Mobile: stack the elements vertically */
@media (max-width: 650px) {
    body.dashboard-page .schedule-form {
        grid-template-columns: minmax(0, 1fr);
    }

    body.dashboard-page .schedule-form > .next {
        grid-column: 1;
        grid-row: 1;
    }

    body.dashboard-page .schedule-form > .schedule-settings {
        grid-column: 1;
        grid-row: 2;
    }

    body.dashboard-page .schedule-form > .schedule-save {
        grid-column: 1;
        grid-row: 3;
        justify-self: stretch;
        width: 100%;
    }

    body.dashboard-page .schedule-form > .last-watering {
        grid-column: 1;
        grid-row: 4;
    }
}

/* LAST WATERING — RIGHT ALIGNMENT */

@media (min-width: 651px) {
    body.dashboard-page .schedule-form > .last-watering {
        grid-column: 2;
        grid-row: 3;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        width: 100%;
    }

    body.dashboard-page .schedule-form > .last-watering > .detail {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        width: max-content;
        max-width: 100%;
        text-align: right;
    }

    body.dashboard-page .schedule-form > .last-watering > .detail small,
    body.dashboard-page .schedule-form > .last-watering > .detail strong {
        text-align: right;
    }
}


/* =========================================================
   FYTELIO — FINAL BRAND THEME
   Εταιρική ταυτότητα και τελικές διορθώσεις εμφάνισης
   Τοποθέτηση στο ΤΕΛΟΣ του theme.css
   ========================================================= */

:root {
    color-scheme: dark;

    /* Fytelio brand colors */
    --sp-bg: #071719;
    --sp-panel: #0b2221;
    --sp-panel-light: #10312e;
    --sp-panel-dark: #091d1c;
    --sp-panel-hover: #173d38;

    --sp-border: #24534d;
    --sp-border-light: #326b60;

    --sp-text: #edf7f4;
    --sp-text-muted: #a9c5bd;
    --sp-text-dim: #829e95;

    --sp-green: #399b43;
    --sp-green-light: #78d17c;
    --sp-green-dark: #174c37;

    --sp-blue: #159bd7;
    --sp-red: #ff6868;
    --sp-orange: #ffad4d;

    --sp-radius: 13px;
    --sp-radius-large: 18px;
    --sp-shadow: 0 18px 44px #0004;
}

/* BASE */

html,
body {
    background: var(--sp-bg);
    color: var(--sp-text);
}

a {
    color: var(--sp-green-light);
}

a:hover {
    color: #a5e9a8;
}

/* HEADER / BRAND */

.topbar {
    min-height: 82px;
    padding: 10px 0;
    border-bottom-color: var(--sp-border);
}

.brand span {
    color: var(--sp-green-light);
}
/* NAVIGATION */

.top-actions a,
.logout {
    background: #123a36;
    border: 1px solid #24534d;
    color: var(--sp-text);
}

.top-actions a:hover,
.logout:hover {
    background: #1b5148;
    border-color: var(--sp-green);
}

/* PANELS */

.panel {
    border-color: var(--sp-border);
    background: linear-gradient(
        150deg,
        var(--sp-panel),
        var(--sp-panel-light)
    );
}

.card,
.empty,
.device-meta,
.measurement,
.schedule,
.history-chart,
.device-picker {
    border-color: var(--sp-border);
    background-color: var(--sp-panel-dark);
}

.device-picker a,
.detail,
.history-weather > div,
.history-weather > span {
    border-color: var(--sp-border);
    background-color: var(--sp-panel-dark);
}

/* BUTTONS */

button,
.btn {
    background: var(--sp-green);
    color: #071b12;
}

button:hover,
.btn:hover {
    background: var(--sp-green-light);
}

.btn-secondary,
button.secondary {
    background: #174c42;
    color: var(--sp-text);
}

.btn-secondary:hover,
button.secondary:hover {
    background: #216356;
}

/* LINKS AND FOCUS */

input:focus,
select:focus,
textarea:focus {
    border-color: var(--sp-blue);
    box-shadow: 0 0 0 2px rgba(21, 155, 215, .18);
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--sp-green);
}

/* TABLES */

thead {
    background: #102e2b;
}

th {
    color: var(--sp-green-light);
    border-bottom-color: var(--sp-border-light);
}

td {
    border-bottom-color: #1c3d38;
}

tbody tr:hover {
    background: #102e2b;
}

/* BADGES */

.badge {
    background: #174c37;
    color: #b9f0b6;
}

.badge-info {
    background: #103849;
    color: #75d8fa;
}

/* DEVICE STATUS */

.device-status.active {
    color: var(--sp-green-light);
    background: rgba(57, 155, 67, .13);
}

.device-status.inactive {
    color: #ffaaaa;
    background: rgba(255, 104, 104, .12);
}

/* MEASUREMENTS */

.measurement {
    background: #091d1c;
    border-color: var(--sp-border);
}

.measurement.humidity strong,
.measurement .measurement-value.humidity-value,
.measurement .value.humidity,
.humidity-value {
    color: #54cfff;
}

/* SCHEDULE */

.schedule {
    background: linear-gradient(135deg, #10312b, #174334);
    border-color: #326b50;
}

.next {
    background: #0b2420;
    border-color: var(--sp-border);
}

.next strong {
    color: var(--sp-green-light);
}

.detail {
    background: #0b2220;
}

/* PUMP STATUS */

.pump-status.is-on {
    color: #9ae878;
    border-color: rgba(57, 155, 67, .65);
    background: rgba(57, 155, 67, .13);
}

.pump-status.is-on .pump-switch {
    background: var(--sp-green);
}

.pump-status.is-off {
    color: #ff8585;
}

.pump-status.is-pending {
    color: var(--sp-orange);
}

/* WEATHER */

.weather-summary img {
    filter: drop-shadow(0 7px 14px rgba(21, 155, 215, .13));
}

/* HISTORY */

.history-chart {
    background: #091d1c;
    border-color: var(--sp-border);
}

.history-weather > div,
.history-weather > span {
    background: #0b2420;
    border-color: #1d403a;
}

.legend-mark.temperature {
    background: var(--sp-orange);
}

.legend-mark.humidity {
    background: var(--sp-blue);
}

.legend-mark.watering {
    background: var(--sp-green);
}

/* FROST PROTECTION */

.frost-status.active,
.frost-status.is-locked {
    border-color: rgba(21, 155, 215, .5);
    background: rgba(21, 155, 215, .09);
    color: #a9eaff;
}

/* DEVICE PICKER */

.device-picker {
    background: var(--sp-panel);
}

.device-picker a:hover,
.device-picker a.selected {
    border-color: var(--sp-green-light);
    background: #14352d;
}

/* HOME PAGE */

.sp-home .feature {
    background: #0b2420;
    border-color: var(--sp-border);
}

.sp-home .schedule {
    background: linear-gradient(135deg, #10312b, #174334);
    border-color: #326b50;
}

.sp-home .device-meta {
    background: #091d1c;
    border-color: var(--sp-border);
}

.sp-home .measurement {
    background: #091d1c;
    border-color: var(--sp-border);
}

.sp-home .history-chart {
    background: #091d1c;
    border-color: var(--sp-border);
}

.sp-home .topbar a.login {
    background: linear-gradient(135deg, #087fae, #159bd7);
    border-color: #45bce8;
    box-shadow: 0 4px 12px rgba(21, 155, 215, .2);
}

.sp-home .topbar a.login:hover {
    background: linear-gradient(135deg, #159bd7, #36b8e9);
    box-shadow: 0 6px 16px rgba(21, 155, 215, .3);
}

/* DASHBOARD PAGE */

body.dashboard-page .device-meta,
body.dashboard-page .measurement,
body.dashboard-page .history-chart {
    background: #091d1c;
    border-color: var(--sp-border);
}

body.dashboard-page .schedule {
    background: linear-gradient(135deg, #10312b, #174334);
    border-color: #326b50;
}

body.dashboard-page .next,
body.dashboard-page .detail {
    background: #0b2420;
    border-color: var(--sp-border);
}

body.dashboard-page .schedule-settings input,
body.dashboard-page .manual-duration input {
    background: var(--sp-bg);
    border-color: #326b60;
}

body.dashboard-page .schedule-settings input:focus,
body.dashboard-page .manual-duration input:focus {
    border-color: var(--sp-blue);
}

body.dashboard-page .schedule-save {
    background: var(--sp-green);
    color: #071b12;
}

body.dashboard-page .schedule-save:hover {
    background: var(--sp-green-light);
}

body.dashboard-page .device-picker {
    background: var(--sp-panel);
    border-color: var(--sp-border);
}

body.dashboard-page .device-picker a {
    background: #091d1c;
    border-color: var(--sp-border);
}

body.dashboard-page .device-picker a:hover,
body.dashboard-page .device-picker a.selected {
    background: #14352d;
    border-color: var(--sp-green-light);
}

body.dashboard-page .weather-update-error {
    color: #ffad4d;
}

/* FOOTER */

.foot,
.sp-home .footer {
    color: var(--sp-text-dim);
    border-top-color: var(--sp-border);
}

/* RESPONSIVE — FYTELIO BRAND */

@media (max-width: 700px) {
    .brand {
        height: auto;
        margin-left: 0;
    }

    .brand img {
        width: min(380px, 100%);
        max-width: 100%;
        height: auto;
    }

    .sp-home .topbar {
        flex-wrap: wrap;
    }

    .sp-home .topbar .brand {
        flex: 0 1 100%;
        width: 100%;
    }

    body.dashboard-page .topbar {
        flex-wrap: wrap;
    }

    body.dashboard-page .topbar .brand {
        flex: 0 1 100%;
        width: 100%;
    }
}

/* =========================================================
   FYTELIO — FINAL CSS FIXES
   Γραμματοσειρά ενδείξεων και θέση λογοτύπου
   ========================================================= */

/* LOGO — ίδια σωστή θέση σε desktop και mobile */
.brand {
    margin-left: -50;
}

/* DIGITAL FONT — χρήση της γραμματοσειράς που έχει δηλωθεί
   στο @font-face ως DSEG7 */
.sp-home .measurement > .value {
    font-family: "DSEG7", "Courier New", monospace;
}

body.dashboard-page .measurement-value {
    font-family: "DSEG7", "Courier New", monospace;
}

/* Διατήρηση της ίδιας γραμματοσειράς και στις κοινές ενδείξεις */
.measurement strong,
.measurement .measurement-value,
.measurement .value {
    font-family: "DSEG7", "Courier New", monospace;
}

/* RESPONSIVE — διατήρηση της σωστής θέσης του λογοτύπου */
@media (max-width: 700px) {
    .brand {
        margin-left: 0;
    }
}

/* =========================================================
   FYTELIO — LOGIN & REGISTRATION
   Ενιαία μορφοποίηση σύνδεσης και εγγραφής
   ========================================================= */

.sp-login-body,
.sp-register-body {
    margin: 0;
    min-height: 100vh;
    background: var(--sp-bg);
    color: var(--sp-text);
}

.sp-login-page,
.sp-register-page {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 35px 16px;
}

.sp-login-card,
.sp-register-card {
    display: block;
    width: 100%;
    max-width: 470px;
    margin: 0 auto;
    padding: 35px;
    background: #174b35;
    color: #ffffff;
    border: 1px solid #286447;
    border-radius: 18px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.22);
}

.sp-login-card {
    max-width: 420px;
}

.sp-login-logo,
.sp-register-logo {
    display: block;
    margin: 0 auto 24px;
    padding: 12px;
    background: transparent;
    border-radius: 12px;
    text-align: center;
}

.sp-login-logo img,
.sp-register-logo img {
    display: block;
    width: 190px;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.sp-login-card h1,
.sp-register-card h1 {
    margin: 0;
    color: #ffffff;
    font-size: 26px;
    text-align: center;
}

.sp-login-subtitle,
.sp-register-subtitle {
    margin: 10px 0 25px;
    color: #d5e8dc;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

.sp-login-card label,
.sp-register-card label {
    display: block;
    margin: 17px 0 7px;
    color: #f0f7f1;
    font-size: 14px;
    font-weight: 600;
}

.sp-login-card input,
.sp-register-card input {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 12px 13px;
    box-sizing: border-box;
    border: 1px solid #cbdacf;
    border-radius: 8px;
    background: #f8fbf9;
    color: #263b30;
    font-size: 15px;
}

.sp-login-card input::placeholder,
.sp-register-card input::placeholder {
    color: #89988e;
    opacity: 1;
}

.sp-login-card input:focus,
.sp-register-card input:focus {
    outline: none;
    border-color: #9ae878;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(154, 232, 120, 0.2);
}

.sp-register-card .sp-activation-input {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: monospace;
    font-size: 16px;
}

.sp-register-help {
    margin: 7px 0 0;
    color: #d5e8dc;
    font-size: 12px;
    line-height: 1.5;
}

.sp-login-card button,
.sp-register-card button {
    display: block;
    width: 100%;
    margin-top: 25px;
    padding: 14px;
    border: 0;
    border-radius: 8px;
    background: #9ae878;
    color: #173b28;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.sp-login-card button:hover,
.sp-register-card button:hover {
    background: #b0f28f;
}

.sp-login-error,
.sp-login-success,
.sp-register-error {
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.sp-login-error,
.sp-register-error {
    border: 1px solid #f0cfca;
    background: #fff0ef;
    color: #a52c27;
}

.sp-login-success {
    border: 1px solid #c8e4cf;
    background: #e8f5eb;
    color: #246b45;
}

.sp-login-register,
.sp-login-home,
.sp-register-login,
.sp-register-home {
    display: block;
    color: #c5f2ae;
    font-size: 14px;
    text-align: center;
    text-decoration: none;
}

.sp-login-register,
.sp-register-login {
    margin-top: 24px;
}

.sp-login-home,
.sp-register-home {
    margin-top: 16px;
}

.sp-login-register:hover,
.sp-login-home:hover,
.sp-register-login:hover,
.sp-register-home:hover {
    color: #ffffff;
    text-decoration: underline;
}

@media (max-width: 480px) {
    .sp-login-card,
    .sp-register-card {
        padding: 27px 22px;
    }

    .sp-login-card h1,
    .sp-register-card h1 {
        font-size: 22px;
    }
}
