:root {
  --bg: #0e1512;
  --panel: #16201b;
  --panel-2: #1d2a23;
  --line: #2a3a30;
  --text: #e8f0ea;
  --muted: #8aa394;
  --accent: #3ddc84;
  --water: #1fa6e0;
  --nitro: #1f7a32;
  --phos: #e07b1f;
  --pot: #b02fae;
  --warn: #e0b81f;
  --bad: #e0563f;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 80% -10%, #18261f 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; border-bottom: 1px solid var(--line);
  background: rgba(13,20,16,0.6); backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 16px; }
.logo { height: 60px; width: auto; object-fit: contain; display: block; border-radius: 8px; }
.topbar h1 { margin: 0; font-size: 22px; letter-spacing: 0.5px; }
.topbar h1 .thin { color: var(--accent); font-weight: 300; }
.tagline { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }

.status { display: flex; gap: 8px; }
.pill {
  font-size: 12px; padding: 5px 11px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
}
.pill.good { color: #0e1512; background: var(--accent); border-color: var(--accent); }
.pill.bad  { color: #fff; background: var(--bad); border-color: var(--bad); }

main { padding: 26px 28px 60px; }
.field {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.empty { color: var(--muted); text-align: center; margin-top: 60px; }

.card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line); border-radius: 16px; padding: 18px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sec-name { margin: 0; font-size: 17px; cursor: pointer; }
.sec-name:hover { color: var(--accent); }
.remove-btn {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  border-radius: 8px; width: 26px; height: 26px; cursor: pointer; font-size: 12px;
  line-height: 1; flex: none;
}
.remove-btn:hover { color: #fff; background: var(--bad); border-color: var(--bad); }

.crop-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.crop-label { font-size: 10px; color: var(--muted); letter-spacing: 1px; }
.crop-select {
  background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 8px; font-size: 13px; flex: 1;
}
.details-btn {
  background: var(--bg); color: var(--muted); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 8px; font-size: 11px; cursor: pointer; flex: none;
}
.details-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ---- gauges: target band + optimal marker + gap ---- */
.gauge { cursor: pointer; }
.gauge:hover .tube, .gauge:hover .ph-scale { border-color: var(--accent); }
.target-band {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0;
  background: rgba(255,255,255,0.10);
  border-top: 1px dashed rgba(255,255,255,0.35);
  border-bottom: 1px dashed rgba(255,255,255,0.35);
  pointer-events: none;
}
.opt-marker {
  position: absolute; left: -3px; right: -3px; top: 50%; height: 0;
  border-top: 2px solid #fff; box-shadow: 0 0 4px #000; pointer-events: none;
}
.fill.out { filter: saturate(0.5) brightness(0.85); }
.g-gap { font-size: 10.5px; color: var(--muted); min-height: 13px; }
.g-gap.under { color: var(--warn); }
.g-gap.over { color: var(--bad); }
.g-gap.ok { color: var(--accent); }

.gauge.ph .ph-scale { position: relative; }
.ph-band {
  position: absolute; left: -2px; right: -2px; bottom: 0; height: 0;
  border: 1.5px solid #fff; border-radius: 4px;
  box-shadow: 0 0 6px rgba(0,0,0,0.6); pointer-events: none;
}

/* ---- add-section card ---- */
.add-card {
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  border-style: dashed; min-height: 160px; color: var(--muted);
  background: transparent;
}
.add-card:hover { border-color: var(--accent); color: var(--accent); }
.add-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.add-plus { font-size: 40px; line-height: 1; }
.add-text { font-size: 14px; letter-spacing: 0.5px; }

/* ---- modal ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal {
  position: relative; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 16px; padding: 24px 26px; max-width: 540px; width: 100%;
  max-height: 86vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-close {
  position: absolute; top: 14px; right: 14px; background: var(--bg);
  border: 1px solid var(--line); color: var(--muted); border-radius: 8px;
  width: 30px; height: 30px; cursor: pointer; font-size: 13px;
}
.modal-close:hover { color: #fff; background: var(--bad); border-color: var(--bad); }
.modal-body h2 { margin: 0 0 4px; font-size: 20px; }
.modal-body .sub { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.modal-body h3 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--muted); margin: 18px 0 8px;
}
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0;
  border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; text-align: right; }
.statline { display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; font-size: 15px; }
.badge { font-size: 12px; padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.badge.ok { background: var(--accent); color: #0e1512; }
.badge.under { background: var(--warn); color: #0e1512; }
.badge.over { background: var(--bad); color: #fff; }
.bigbar { height: 12px; border-radius: 6px; background: #0c120f; overflow: hidden;
  position: relative; margin: 10px 0; border: 1px solid var(--line); }
.bigbar > .seg-band { position: absolute; top: 0; bottom: 0; background: rgba(61,220,132,0.25); }
.bigbar > .seg-cur { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; }

/* ============================ tabs ============================ */
.tabs {
  display: flex; gap: 6px; padding: 12px 28px 0;
  border-bottom: 1px solid var(--line);
}
.tab {
  background: transparent; border: 1px solid transparent; border-bottom: none;
  color: var(--muted); padding: 9px 16px; border-radius: 10px 10px 0 0;
  cursor: pointer; font-size: 14px;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--text); background: var(--panel-2);
  border-color: var(--line); border-bottom-color: var(--panel-2);
  margin-bottom: -1px; font-weight: 600;
}
.view { padding: 22px 28px 60px; }
.view[hidden] { display: none; }

/* ========================= field map ========================= */
.map-toolbar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 18px;
}
.colorby { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.colorby select {
  background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; font-size: 13px;
}
.map-toolbar .hint { font-size: 12px; color: var(--muted); margin-left: auto; }
.legend { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.legend .swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line); }
.legend .bar { width: 120px; height: 12px; border-radius: 6px; border: 1px solid var(--line); }

.map-board {
  --scale: 22px;            /* pixels per real-world metre (set by zoom) */
  position: relative;
  background:
    linear-gradient(rgba(61,220,132,0.06) 1px, transparent 1px) 0 0 / var(--scale) var(--scale),
    linear-gradient(90deg, rgba(61,220,132,0.06) 1px, transparent 1px) 0 0 / var(--scale) var(--scale),
    linear-gradient(rgba(61,220,132,0.13) 1px, transparent 1px) 0 0 / calc(var(--scale) * 5) calc(var(--scale) * 5),
    linear-gradient(90deg, rgba(61,220,132,0.13) 1px, transparent 1px) 0 0 / calc(var(--scale) * 5) calc(var(--scale) * 5),
    var(--bg);
  background-position: var(--pad, 14px) var(--pad, 14px);
  border: 1px solid var(--line); border-radius: 14px;
  width: 100%; min-height: 420px; overflow: auto;
}

.tile {
  position: absolute; border-radius: 10px; padding: 8px 9px;
  border: 1px solid rgba(255,255,255,0.16); cursor: grab;
  display: flex; flex-direction: column; gap: 3px; color: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3); user-select: none; touch-action: none;
  overflow: hidden; box-sizing: border-box;
}
.tile:hover { box-shadow: 0 8px 22px rgba(0,0,0,0.5); z-index: 5; }
.tile.moving { cursor: grabbing; z-index: 20; opacity: 0.92; }
.tile.oversize { border: 2px solid var(--bad); box-shadow: 0 0 0 2px rgba(224,86,63,0.4), 0 6px 18px rgba(0,0,0,0.5); }
.tile.irrigating::after {
  content: ""; position: absolute; inset: 0; border-radius: 10px;
  box-shadow: inset 0 0 0 2px #44c4f0; animation: pulse 1.2s ease-in-out infinite; pointer-events: none;
}
@keyframes pulse { 0%,100% { opacity: 0.25; } 50% { opacity: 0.9; } }
.tile-top { display: flex; align-items: center; gap: 5px; }
.tile-name { flex: 1; min-width: 0; font-size: 12px; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-dot { width: 9px; height: 9px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.4); flex: none; }
.tile-crop {
  font-size: 10.5px; opacity: 0.92; text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile-metric { margin-top: auto; display: flex; align-items: baseline; gap: 3px; }
.tile-val { font-size: 24px; font-weight: 800; text-shadow: 0 1px 3px rgba(0,0,0,0.7); line-height: 1; }
.tile-unit { font-size: 11px; opacity: 0.85; }
.tile-foot { font-size: 10px; opacity: 0.9; text-shadow: 0 1px 2px rgba(0,0,0,0.6); min-height: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-size {
  flex: none; font-size: 9px; font-weight: 600; color: rgba(255,255,255,0.9);
  background: rgba(0,0,0,0.4); padding: 1px 5px; border-radius: 6px;
  pointer-events: none; white-space: nowrap;
}
.tile.oversize .tile-size { background: var(--bad); color: #fff; }
.resize-handle {
  position: absolute; right: 0; bottom: 0; width: 16px; height: 16px; cursor: nwse-resize;
  background:
    linear-gradient(135deg, transparent 50%, rgba(255,255,255,0.6) 50%, rgba(255,255,255,0.6) 62%, transparent 62%, transparent 74%, rgba(255,255,255,0.6) 74%, rgba(255,255,255,0.6) 86%, transparent 86%);
  border-bottom-right-radius: 10px;
}
/* hide secondary text on very small tiles */
.tile.compact .tile-crop, .tile.compact .tile-foot, .tile.compact .tile-metric { display: none; }
.tile.compact .tile-size { font-size: 8px; padding: 0 4px; }

.tile.add-tile {
  background: transparent; border: 1.5px dashed var(--line); color: var(--muted);
  align-items: center; justify-content: center; box-shadow: none; flex-direction: row; gap: 8px;
  cursor: pointer;
}
.tile.add-tile:hover { border-color: var(--accent); color: var(--accent); }
.tile.add-tile .add-plus { font-size: 28px; line-height: 1; }
.tile.add-tile .resize-handle, .tile.add-tile .tile-size { display: none; }

.zoom { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.zoom input { accent-color: var(--accent); }

.soil-btn {
  background: var(--bg); color: var(--muted); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 11px; font-size: 12px; cursor: pointer;
}
.soil-btn:hover { color: var(--accent); border-color: var(--accent); }
.soil-btn:disabled { opacity: 0.4; cursor: default; color: var(--muted); border-color: var(--line); }
.soil-btn.armed { background: var(--accent); color: #0e1512; border-color: var(--accent); font-weight: 700; }
.geo-controls { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.geo-controls[hidden] { display: none; }
.geo-modes { display: inline-flex; gap: 2px; padding: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; }
.geo-modes .soil-btn { border: none; }

/* soil-limit settings form (inside modal) */
.soil-form { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.soil-row {
  display: grid; grid-template-columns: 56px 86px 16px 64px 1fr;
  align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line);
}
.soil-name { text-transform: capitalize; font-weight: 600; }
.soil-input {
  background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 8px; width: 100%; font-size: 13px;
}
.soil-input:focus { outline: none; border-color: var(--accent); }
.soil-unit { color: var(--muted); font-size: 12px; }
.soil-area { color: var(--accent); font-size: 13px; }
.soil-def { color: var(--muted); font-size: 11px; text-align: right; }
.soil-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }
.btn-primary {
  background: var(--accent); color: #0e1512; border: none; border-radius: 8px;
  padding: 9px 20px; font-weight: 700; cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary {
  background: var(--bg); color: var(--muted); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 14px; cursor: pointer;
}
.btn-secondary:hover { color: var(--text); }

/* ===================== rain-skip banner ===================== */
.rain-banner {
  display: flex; align-items: center; gap: 10px;
  margin: 0 28px; margin-top: 12px; padding: 11px 16px;
  background: linear-gradient(90deg, rgba(31,166,224,0.22), rgba(31,166,224,0.08));
  border: 1px solid #2f6fa0; border-radius: 10px; color: #cdeafa; font-size: 13.5px;
}
.rain-banner[hidden] { display: none; }
.rain-banner b { color: #fff; }

/* ===================== climate view ===================== */
.climate-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.climate-head h2 { margin: 0; font-size: 20px; }
.climate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.climate-card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-bottom: 16px;
}
.climate-card h3 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--muted); margin: 0 0 12px;
}
.climate-card h3 .src { float: right; text-transform: none; letter-spacing: 0; font-size: 10px;
  color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }

.cur-main { display: flex; align-items: baseline; gap: 12px; }
.cur-temp { font-size: 42px; font-weight: 800; }
.cur-cond { font-size: 16px; color: var(--text); }
.cur-stats { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; color: var(--muted); font-size: 13px; }
.cur-stats b { color: var(--text); }

.adv-state { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.adv-state.skip { color: var(--water); }
.adv-state.go { color: var(--accent); }
.adv-reason { color: var(--muted); font-size: 13px; margin: 0; }

.forecast-hours { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.fh {
  flex: 0 0 auto; width: 52px; text-align: center; background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 4px;
}
.fh .fh-time { font-size: 10.5px; color: var(--muted); }
.fh .fh-temp { font-size: 14px; font-weight: 600; margin: 4px 0; }
.fh .fh-rainbar { height: 34px; display: flex; align-items: flex-end; justify-content: center; }
.fh .fh-rainbar > i { display: block; width: 10px; background: linear-gradient(180deg,#44c4f0,var(--water)); border-radius: 3px 3px 0 0; min-height: 2px; }
.fh .fh-mm { font-size: 10px; color: var(--water); }
.fh.wet { border-color: #2f6fa0; }

.forecast-days { display: flex; gap: 8px; flex-wrap: wrap; }
.fd {
  flex: 1 1 90px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px; min-width: 88px;
}
.fd .fd-day { font-size: 12px; font-weight: 600; }
.fd .fd-temp { font-size: 13px; margin: 6px 0; }
.fd .fd-temp .lo { color: var(--muted); }
.fd .fd-rain { font-size: 12px; color: var(--water); }

.rain-calendar { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; align-items: end; height: 160px; }
.rc { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.rc-bar { width: 70%; background: linear-gradient(180deg,#44c4f0,var(--water)); border-radius: 4px 4px 0 0; min-height: 3px; }
.rc-mm { font-size: 9.5px; color: var(--muted); }
.rc-mo { font-size: 10.5px; color: var(--muted); }

/* settings form rows reused for farm settings */
.set-row { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.set-row label { color: var(--muted); font-size: 13px; }
.set-row input, .set-row select {
  background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 9px; font-size: 13px; width: 100%;
}
.set-row input:focus, .set-row select:focus { outline: none; border-color: var(--accent); }
.set-inline { display: flex; gap: 8px; align-items: center; }
.set-inline input { width: auto; flex: 1; }

@media (max-width: 720px) { .climate-grid { grid-template-columns: 1fr; } }

/* ===================== geo map ===================== */
.geo-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.geo-search {
  flex: 1 1 280px; min-width: 220px; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 14px;
}
.geo-search:focus { outline: none; border-color: var(--accent); }
.geo-info { color: var(--muted); font-size: 13px; margin-left: auto; }
.geo-info b { color: var(--text); }
.gmap {
  width: 100%; height: 68vh; min-height: 420px; border-radius: 14px;
  border: 1px solid var(--line); overflow: hidden; background: #0c120f;
}
.geo-msg {
  margin-top: 12px; padding: 14px 16px; border-radius: 10px;
  background: rgba(224,86,63,0.12); border: 1px solid var(--bad); color: #f3c4bb; font-size: 13.5px;
}
.geo-msg[hidden] { display: none; }
.soil-btn.armed { background: var(--accent); color: #0e1512; border-color: var(--accent); }
.gm-label {
  background: rgba(14,21,18,0.82); color: #fff; border: 1px solid var(--accent);
  border-radius: 6px; padding: 2px 7px; font-size: 12px; font-weight: 600; white-space: nowrap;
  transform: translate(-50%, -50%);
}

/* detail overlay reuses the section card inside the modal */
.modal.wide { max-width: 460px; }
.modal .card { border: none; box-shadow: none; background: transparent; padding: 0; }
.modal .card .remove-btn { display: none; }

.gauges { display: flex; gap: 10px; align-items: flex-end; margin: 18px 0 6px; }
.gauge { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
.tube {
  width: 100%; max-width: 46px; height: 120px; border: 1.5px solid var(--line);
  border-radius: 10px; background: #0c120f; position: relative; overflow: hidden;
}
.fill {
  position: absolute; bottom: 0; left: 0; right: 0; height: 0%;
  border-radius: 0 0 8px 8px; transition: height 0.8s cubic-bezier(.4,1.3,.5,1);
}
.fill.water { background: linear-gradient(180deg, #44c4f0, var(--water)); }
.fill.nitro { background: linear-gradient(180deg, #2fa84a, var(--nitro)); }
.fill.phos  { background: linear-gradient(180deg, #f59b46, var(--phos)); }
.fill.pot   { background: linear-gradient(180deg, #d04fce, var(--pot)); }
.g-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.g-val { font-size: 12px; color: var(--text); }

/* pH scale 0-14 */
.gauge.ph .ph-scale {
  width: 100%; max-width: 46px; height: 120px; border: 1.5px solid var(--line);
  border-radius: 10px; position: relative;
  background: linear-gradient(180deg,
    #6b3fb0 0%, #2f6fd0 20%, #2fa84a 50%, #e0b81f 72%, #e0563f 100%);
}
.ph-marker {
  position: absolute; left: -4px; right: -4px; height: 0; border-top: 3px solid #fff;
  box-shadow: 0 0 4px #000; transition: top 0.8s ease; top: 50%;
}

.meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.chip {
  font-size: 12px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 4px 9px; color: var(--muted);
}
.chip b { color: var(--text); font-weight: 600; }

.reco h3, .action h3 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--muted); margin: 14px 0 8px;
}
.reco-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.reco-list li {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
}
.reco-rank { color: var(--accent); font-weight: 700; font-size: 13px; }
.reco-name { flex: 1; font-size: 13.5px; }
.bar { width: 70px; height: 6px; background: #0c120f; border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.reco-score { font-size: 11px; color: var(--muted); width: 32px; text-align: right; }

.action-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted); margin-left: 6px; vertical-align: middle;
}
.action-dot.active { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.action-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.action-notes li { font-size: 12.5px; color: var(--text); padding-left: 14px; position: relative; }
.action-notes li::before { content: "›"; position: absolute; left: 0; color: var(--accent); }

footer {
  display: flex; justify-content: space-between; padding: 16px 28px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 12px;
}

/* ---------- user/farm bar ---------- */
.userbar {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 28px; border-bottom: 1px solid var(--line);
  background: rgba(13,20,16,0.45);
}
.userbar .farm-pick { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.userbar select {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; font-size: 13px; font-family: inherit; max-width: 360px;
}
.userbar select:disabled { opacity: 0.75; }
.userbar-spacer { flex: 1; }
.user-id { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.user-id b { font-size: 13px; }
.user-role { color: var(--accent); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
#farm-new { white-space: nowrap; }

/* ---------- sign-in overlay ---------- */
.auth-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(900px 500px at 50% 0%, #16261d 0%, #0a100d 70%);
}
.auth-card {
  width: min(380px, 92vw); background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 34px 30px; text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,0.55); display: flex; flex-direction: column; gap: 13px;
}
.auth-logo { height: 64px; width: auto; object-fit: contain; margin: 0 auto 4px; border-radius: 10px; }
.auth-card h2 { margin: 0; font-size: 22px; }
.auth-sub { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.auth-card input {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; color: var(--text); font-size: 14px; font-family: inherit; outline: none;
}
.auth-card input:focus { border-color: var(--accent); }
.auth-card button {
  background: var(--accent); color: #06130b; border: none; border-radius: 10px;
  padding: 12px; font-size: 14px; font-weight: 700; cursor: pointer; margin-top: 4px;
}
.auth-card button:disabled { opacity: 0.6; cursor: default; }
.auth-error { color: var(--bad); font-size: 13px; margin: 2px 0 0; }

.auth-show { display: flex; align-items: center; gap: 8px; justify-content: flex-start;
  color: var(--muted); font-size: 0.85rem; cursor: pointer; margin: -4px 0 2px; user-select: none; }
.auth-show input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }

/* the hidden attribute must win over display:flex, or the overlay never hides */
.auth-overlay[hidden] { display: none !important; }
