/* Additions to the simulator's CSS for live data. Everything else on the page
   is the simulator's own styling (agriculture-*.css, v18.css), unchanged.
   Kept small on purpose: only states and controls the simulator never had. */

/* A device that has not reported for 15 minutes: grey, dashed, last known position. */
.status-offline .asset-panel,.status-offline .valve-body,.status-offline .pump-card{stroke:#6f8792!important;stroke-dasharray:5 4;fill:#1a2a31!important}
.status-offline .asset-title,.status-offline .asset-data,.status-offline .valve-label{fill:#8ea3ac!important}
.status-offline .handle,.status-offline .handle-knob{opacity:.55}
.state-box.status-offline{background:#1a2a31;color:#9db2bb}
.source-card.status-offline{border-color:#6f8792;border-style:dashed}
.key i.status-offline-key{width:24px;height:13px;border-radius:4px;background:#1a2a31;border:2px dashed #6f8792}

/* Page links in the side rail (the simulator's rail had buttons). */
nav a.active{background:#d7b675;color:#102029}

/* Page links styled as the simulator's buttons. */
a.action,a.mini-btn{text-decoration:none;display:inline-flex;align-items:center;justify-content:center}

/* Farm chooser in the header controls, sized like the simulator's buttons. */
.controls select{padding:8px 11px;border:1px solid #36515e;border-radius:8px;background:#10232d;color:#edf3f5;font:inherit;font-size:.76rem;font-weight:750}

/* Empty and error states inside the network card. */
.network-empty{padding:48px 20px;text-align:center;color:#9db2bb;font-size:.85rem}
.network-empty b{display:block;color:#edf3f5;font-size:1rem;margin-bottom:6px}

/* ---- Pages beyond the dashboard: built from the simulator's tokens and cards ---- */

/* Tables (valves, history). Same colours as the simulator's panels. */
.table-wrap{overflow-x:auto}
.data-table{width:100%;border-collapse:collapse;font-size:.74rem;color:#edf3f5;min-width:760px}
.data-table th{text-align:left;padding:10px;color:#9bb0b9;font-size:.6rem;letter-spacing:.08em;text-transform:uppercase;border-bottom:1px solid #35515e;font-weight:800}
.data-table td{padding:9px 10px;border-bottom:1px solid #23404c;vertical-align:top}
.data-table tr.row-link{cursor:pointer}
.data-table tr.row-link:hover td,.data-table tr.row-link:focus-visible td{background:#12303b}
.data-table td small{display:block;color:#9bb0b9;font-size:.64rem;margin-top:2px}
.data-table .num{font-variant-numeric:tabular-nums}
.pill{display:inline-block;border-radius:20px;padding:3px 9px;font-size:.6rem;font-weight:850;letter-spacing:.05em;text-transform:uppercase;background:#1a2a31;color:#9db2bb;white-space:nowrap}
.pill.operating{background:#10372c;color:#a1e0c7}.pill.hold{background:#14364a;color:#bce9ff}
.pill.manual{background:#3a1418;color:#f19aa2}.pill.fault,.pill.critical{background:#d4001c;color:#fff}
.pill.protective,.pill.warning{background:#3a2a10;color:#e2a13a}.pill.offline{background:#1a2a31;color:#9db2bb;border:1px dashed #6f8792}

/* Search box and selects in the head controls, like the simulator's buttons. */
.controls input[type=search]{padding:8px 11px;border:1px solid #36515e;border-radius:8px;background:#10232d;color:#edf3f5;font:inherit;font-size:.76rem;min-width:220px}

/* Grids of cards inside the main column. */
.page-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:12px}
.page-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.page-grid > *{min-width:0}
@media(max-width:900px){.page-grid,.page-grid.three{grid-template-columns:1fr}}
.card-body{padding:13px;display:flex;flex-direction:column;gap:8px}
.empty{padding:28px 16px;text-align:center;color:#9db2bb;font-size:.8rem}
.empty b{display:block;color:#edf3f5;font-size:.95rem;margin-bottom:4px}
.note{font-size:.68rem;color:#9db2bb}

/* In-page confirmation (the viewer and some browsers block dialogs). */
.confirm-backdrop{position:fixed;inset:0;background:rgba(3,10,14,.72);display:grid;place-items:center;z-index:50;padding:16px}
.confirm-card{max-width:420px;width:100%;box-shadow:0 20px 60px rgba(0,0,0,.5)}

/* Map page. */
#leafletMap{height:620px;border-radius:0 0 10px 10px;background:#0b1a22}
.map-dot{width:16px;height:16px;border-radius:50%;border:3px solid #edf3f5;box-shadow:0 0 0 2px rgba(0,0,0,.35)}
.map-dot.pump{width:20px;height:20px;border-radius:5px}
.map-dot.tvalve{border-color:#29b7e6}
.map-label{background:#0f2029;color:#edf3f5;border:1px solid #35515e;border-radius:6px;font-weight:800;font-size:11px;padding:2px 6px;box-shadow:none}
.map-label:before{display:none}

/* Schedules calendar. */
.cal{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;padding:13px}
.cal-day{background:#102731;border:1px solid #2c4a57;border-radius:8px;min-height:92px;padding:6px;font-size:.62rem;color:#9db2bb;display:flex;flex-direction:column;gap:4px;text-align:left;font:inherit}
.cal-day.today{border:2px solid #d7b675}
.cal-day.other{opacity:.45}
.cal-day b{color:#edf3f5;font-size:.72rem}
.cal-run{border-radius:5px;padding:3px 5px;background:#14364a;color:#bce9ff;font-size:.58rem;font-weight:800}
.cal-run.done{background:#10372c;color:#a1e0c7}.cal-run.missed{background:#3a1418;color:#f19aa2}
.cal-power{height:4px;border-radius:2px;background:#10372c}

/* 24-hour power line. */
.dayline{position:relative;height:34px;border-radius:8px;background:#0b1a22;border:1px solid #35515e;overflow:hidden}
.dayline i{position:absolute;top:0;bottom:0;background:#10372c}
.dayline i.cut{background:#3a2a10}
.dayline b{position:absolute;top:0;bottom:0;width:2px;background:#d7b675}
.dayline-scale{display:flex;justify-content:space-between;font-size:.6rem;color:#9db2bb;margin-top:4px}

/* Range input for valve position, in the gold of the simulator's handles. */
input[type=range]{width:100%;accent-color:#d7b675}

/* Sign-in page. */
.signin-wrap{min-height:calc(100vh - 64px);display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:48px;padding:40px 20px;box-sizing:border-box}
.signin-card{flex:0 1 400px;padding:24px;display:flex;flex-direction:column;gap:14px}
.signin-card input{padding:10px;font-size:.85rem}
.signin-msg{font-size:.72rem;padding:9px;border-radius:7px}

/* Controls that cannot be used right now (already at that position, or a command is on its way). */
.action:disabled,.mini-btn:disabled,.day-btn:disabled,.field-btn:disabled{opacity:.45;cursor:not-allowed}

/* Valve control panel: dark cards with a coloured edge for every state, so the white text
   always reads (the simulator's light card fills are for its small starter cards). */
#valveControls .source-card{background:#102731;color:#edf3f5;animation:none}
#valveControls .source-card.status-operating{background:#10372c;border-color:#5fbe99}
#valveControls .source-card.status-hold{background:#14364a;border-color:#5e9dca}
#valveControls .source-card.status-manual{background:#2a1418;border-color:#c83b47}
#valveControls .source-card.status-protective{background:#2a2010;border:2px solid #e2a13a}
#valveControls .source-card.status-fault{background:#3a1418;border:2px solid #d4001c}
#valveControls .source-card .source-data div{background:rgba(255,255,255,.04)}
#valveControls .source-card .source-data strong,#valveControls .source-card .source-name{color:#edf3f5}
#valveControls .source-card .source-data span,#valveControls .source-card label{color:#9db2bb}
#valveControls .source-card .state-pill{background:#0b1a22;color:#edf3f5}
#valveControls .source-card.status-operating .state-pill{color:#a1e0c7}
#valveControls .source-card.status-manual .state-pill{color:#f19aa2}
#valveControls .source-card.status-hold .state-pill{color:#bce9ff}

/* Header: the OrbiPulse product first; the company stays small. */
.product-brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:inherit;min-width:0}
.product-logo{width:40px;height:40px;border-radius:10px;flex:none;box-shadow:0 0 0 1px rgba(215,182,117,.35)}
.product-type{display:flex;flex-direction:column;line-height:1.1;min-width:0}
.product-type b{font-size:1.2rem;font-weight:850;color:#f1f3ee;letter-spacing:.01em}
.product-type b em{font-style:normal;color:#e9b949}
.product-type small{font-size:.62rem;color:#9bb0b9;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* A T-valve port with no pipe: faint, so it reads as unused rather than broken. */
.port-label.unused{opacity:.3}
.map-notes{margin:0 13px 10px;font-size:.72rem}
