/* FieldSense — "Audiebant" design system port
   Earthy-green gradient shell · floating content panel · Comfortaa + Montserrat.
   Existing fs-* class names are preserved and restyled, so blade markup is stable. */

:root {
  /* Type */
  --fs-font-display: "Comfortaa", ui-rounded, system-ui, sans-serif;
  --fs-font: "Montserrat", ui-sans-serif, system-ui, sans-serif;
  --fs-font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Earthy green palette */
  --fs-green-50:  #f0f4ef;
  --fs-green-100: #dde6db;
  --fs-green-200: #b8c9b3;
  --fs-green-300: #8fae87;
  --fs-green-400: #6a9462;
  --fs-green-500: oklch(0.48 0.10 145);   /* primary forest */
  --fs-green-600: oklch(0.42 0.10 145);
  --fs-green-700: oklch(0.34 0.09 145);
  --fs-green-900: oklch(0.18 0.05 145);
  --fs-green-tint: #eef2e9;
  --fs-green-tint-border: #dde6d6;

  /* Warm neutrals */
  --fs-paper:       #f5f2ee;   /* canvas */
  --fs-card:        #ffffff;
  --fs-sunk:        #f5f2ee;
  --fs-rail:        #efebe4;
  --fs-ink:         #1c1f1a;
  --fs-ink-2:       #3a372f;
  --fs-muted:       #6b6b5f;
  --fs-muted-2:     #9a988e;
  --fs-border:      #e3ddd2;
  --fs-border-soft: #ece7dd;
  --fs-border-tile: #e3ddd2;
  --fs-border-strong: #c9c1b3;

  /* Accents / status */
  --fs-amber:      oklch(0.72 0.13 68);
  --fs-amber-text: oklch(0.45 0.13 68);
  --fs-amber-bg:   oklch(0.95 0.07 80);
  --fs-amber-border: oklch(0.85 0.10 80);
  --fs-terracotta: #b34a2a;
  --fs-red:        #b34a2a;

  /* Shell */
  --fs-shell-grad: linear-gradient(160deg, #0d1f0f 0%, #1a3d1f 45%, #2d5a30 100%);
  --fs-glass-bg-strong: rgba(255,255,255,0.12);
  --fs-glass-border: rgba(255,255,255,0.14);
  --fs-glass-glow: 0 0 0 1px rgba(255,255,255,0.04), 0 8px 24px rgba(0,0,0,0.18);

  /* Radii */
  --fs-r-sm: 8px;
  --fs-r-md: 12px;
  --fs-r-lg: 16px;
  --fs-r-xl: 20px;
  --fs-r-full: 9999px;

  /* Warm-tinted shadows */
  --fs-shadow-sm: 0 1px 2px rgba(60,50,30,0.05);
  --fs-shadow-md: 0 2px 6px rgba(60,50,30,0.06), 0 1px 2px rgba(60,50,30,0.04);
  --fs-shadow-lg: 0 12px 28px rgba(60,50,30,0.10), 0 2px 6px rgba(60,50,30,0.05);
  --fs-shadow-xl: 0 24px 60px rgba(60,50,30,0.16), 0 4px 12px rgba(60,50,30,0.06);

  --fs-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --fs-t: 200ms;
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--fs-font);
  font-size: 14px;
  line-height: 1.5;
  background: var(--fs-paper);
  color: var(--fs-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5 {
  font-family: var(--fs-font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--fs-ink);
}
h1 { font-size: 26px; }
h2 { font-size: 18px; }
button { font-family: inherit; font-size: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--fs-green-200); color: var(--fs-green-900); }

@keyframes fs-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(179,74,42,.5); }
  70%  { box-shadow: 0 0 0 12px rgba(179,74,42,0); }
  100% { box-shadow: 0 0 0 0 rgba(179,74,42,0); }
}
@keyframes fs-pop { from { transform: scale(0.97); opacity: 0; } to { transform: scale(1); opacity: 1; } }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--fs-border-strong); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ───────── Shell: gradient + sidebar + floating panel ───────── */
.fs-app {
  height: 100vh;
  display: grid;
  grid-template-columns: var(--fs-side-w, 256px) 1fr;
  grid-template-rows: auto auto 1fr;
  grid-template-areas:
    "banner  banner"
    "sidebar topbar"
    "sidebar main";
  background: var(--fs-shell-grad);
  background-attachment: fixed;
  color: var(--fs-ink);
  overflow: hidden;
}
/* Let the existing .fs-body wrapper dissolve so its children (sidebar, main)
   become direct grid items of .fs-app — no per-page markup change needed. */
.fs-body { display: contents; }

.fs-impersonation-banner { grid-area: banner; }
.fs-sidebar { grid-area: sidebar; }
.fs-topbar  { grid-area: topbar; }
.fs-main    { grid-area: main; }

/* ───────── Sidebar (on the dark gradient) ───────── */
.fs-sidebar {
  height: 97vh;
  align-self: center;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 14px;
  display: flex; flex-direction: column; gap: 6px;
  color: rgba(255,255,255,0.92);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.22) transparent;
}
.fs-sidebar::-webkit-scrollbar { width: 8px; }
.fs-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 8px; }

.fs-sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 18px;
  white-space: nowrap;
}
.fs-logo-mark {
  width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(255,255,255,0.20), rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
  display: grid; place-items: center;
}
.fs-logo-text {
  font-family: var(--fs-font-display);
  font-size: 18px; font-weight: 700; letter-spacing: .01em;
  color: #fff;
}
.fs-logo-text span { color: var(--fs-green-200); }

.fs-sidebar-section { padding: 14px 10px 6px; font-family: var(--fs-font-display); font-size: 10px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,0.42); }
.fs-nav { display: flex; flex-direction: column; gap: 4px; }
.fs-nav-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--fs-r-md);
  font-family: var(--fs-font-display);
  font-weight: 500; font-size: 13.5px;
  color: rgba(255,255,255,0.72);
  border: 1px solid transparent;
  transition: background var(--fs-t) var(--fs-ease), color var(--fs-t) var(--fs-ease);
}
.fs-nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.fs-nav-item.is-active {
  background: var(--fs-glass-bg-strong);
  color: #fff;
  border: 1px solid var(--fs-glass-border);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: var(--fs-glass-glow);
}
.fs-nav-item.is-active::before {
  content: ""; position: absolute; left: -1px; top: 9px; bottom: 9px;
  width: 3px; border-radius: 2px;
  background: var(--fs-amber);
  box-shadow: 0 0 12px oklch(0.72 0.13 68 / 0.6);
}
.fs-nav-item.is-disabled { opacity: .4; pointer-events: none; }
.fs-nav-badge {
  margin-left: auto;
  background: var(--fs-amber); color: #1a3d1f;
  font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: var(--fs-r-full);
  display: grid; place-items: center; padding: 0 6px;
}
.fs-soon {
  margin-left: auto; font-size: 9px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.08);
  padding: 3px 7px; border-radius: var(--fs-r-full);
}

/* Sidebar gateway card + user chip */
.fs-gw-card {
  margin-top: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--fs-r-md);
  padding: 12px 13px;
}
.fs-gw-title { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: #fff; font-family: var(--fs-font-display); }
.fs-gw-sub { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 4px; line-height: 1.45; }

.fs-user-chip {
  margin-top: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--fs-r-md);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.fs-user-chip .fs-avatar { width: 34px; height: 34px; flex: 0 0 auto; }
.fs-user-chip .fs-user-meta { display: flex; flex-direction: column; overflow: hidden; line-height: 1.3; }
.fs-user-chip .fs-user-meta b { font-family: var(--fs-font-display); font-weight: 600; font-size: 12.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-user-chip .fs-user-meta span { font-size: 10.5px; color: rgba(255,255,255,0.5); }
.fs-user-chip .fs-logout-form { margin-left: auto; }
.fs-user-chip .fs-icon-btn { width: 32px; height: 32px; background: transparent; border-color: transparent; color: rgba(255,255,255,0.7); }
.fs-user-chip .fs-icon-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }

/* ───────── Topbar (white header of the floating panel) ───────── */
.fs-topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 22px;
  min-height: 60px;
  background: var(--fs-card);
  border: 1px solid var(--fs-border);
  border-bottom: none;
  border-radius: var(--fs-r-xl) var(--fs-r-xl) 0 0;
  margin: 12px 12px 0 6px;
}
.fs-spacer { flex: 1; }
.fs-farm-switch {
  display: inline-flex; align-items: center; gap: 9px;
  height: 36px; padding: 0 14px 0 6px;
  border-radius: var(--fs-r-full);
  border: 1px solid var(--fs-border);
  background: var(--fs-card);
  font-family: var(--fs-font-display);
  font-size: 12.5px; font-weight: 600; color: var(--fs-ink);
  transition: border-color var(--fs-t) var(--fs-ease);
}
.fs-farm-switch:hover { border-color: var(--fs-green-400); }
.fs-farm-switch .fs-dot { width: 22px; height: 22px; border-radius: var(--fs-r-full); background: var(--fs-green-500); }
.fs-farm-switch b { font-weight: 600; }
.fs-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fs-green-500); }
.fs-synced { font-size: 12.5px; color: var(--fs-muted); font-weight: 500; }
.fs-synced .fs-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; vertical-align: middle; }
.fs-icon-btn {
  width: 36px; height: 36px; border-radius: var(--fs-r-md);
  background: transparent; border: 1px solid transparent;
  color: var(--fs-muted);
  display: grid; place-items: center;
  transition: background var(--fs-t) var(--fs-ease), color var(--fs-t) var(--fs-ease);
}
.fs-icon-btn:hover { background: var(--fs-paper); color: var(--fs-ink); border-color: var(--fs-border); }
.fs-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--fs-amber), oklch(0.6 0.14 50));
  color: #1a3d1f; display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
}
.fs-hamburger {
  display: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--fs-r-md);
  background: transparent; border: 1px solid var(--fs-border); color: var(--fs-ink);
}

/* ───────── Main panel body ───────── */
.fs-main {
  overflow-y: auto;
  background: var(--fs-paper);
  border: 1px solid var(--fs-border);
  border-top: none;
  border-radius: 0 0 var(--fs-r-xl) var(--fs-r-xl);
  margin: 0 12px 12px 6px;
  padding: 26px 30px 70px;
}
.fs-canvas { max-width: 1440px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }

.fs-impersonation-banner {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 9px 18px;
  background: var(--fs-amber-bg);
  border-bottom: 1px solid var(--fs-amber-border);
  color: var(--fs-amber-text);
  font-size: 13px; font-weight: 600;
}
.fs-impersonation-banner b { font-weight: 700; }

.fs-scrim { display: none; position: fixed; inset: 0; background: rgba(13,31,15,.45); z-index: 55; }

/* ───────── Cards ───────── */
.fs-card {
  background: var(--fs-card);
  border: 1px solid var(--fs-border);
  border-radius: var(--fs-r-lg);
  box-shadow: var(--fs-shadow-sm);
}
.fs-row { display: flex; flex-wrap: wrap; gap: 18px; align-items: stretch; }
.fs-card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 13px; }
.fs-card-title { font-family: var(--fs-font-display); font-size: 16px; font-weight: 600; color: var(--fs-ink); }
.fs-card-meta { font-size: 13px; color: var(--fs-muted); }

/* ───────── Buttons (pill) ───────── */
.fs-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--fs-r-full);
  font-family: var(--fs-font-display); font-weight: 600; font-size: 13px; letter-spacing: .01em;
  line-height: 1; white-space: nowrap; text-decoration: none;
  background: transparent; color: var(--fs-ink);
  box-sizing: border-box;
  transition: background var(--fs-t) var(--fs-ease), border-color var(--fs-t) var(--fs-ease), filter var(--fs-t) var(--fs-ease), transform 120ms var(--fs-ease);
}
.fs-btn:active { transform: translateY(0.5px); }
.fs-btn-green { background: var(--fs-green-500); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, var(--fs-shadow-sm); }
.fs-btn-green:hover { background: var(--fs-green-600); }
.fs-btn-light, .fs-btn-grey { background: var(--fs-card); border-color: var(--fs-border-strong); color: var(--fs-ink); }
.fs-btn-light:hover, .fs-btn-grey:hover { background: var(--fs-paper); }
.fs-btn-ghost { background: transparent; color: var(--fs-muted); }
.fs-btn-ghost:hover { background: var(--fs-paper); color: var(--fs-ink); }
.fs-modal-foot .fs-btn { flex: 1; }

.fs-link { font-family: var(--fs-font-display); font-size: 13px; font-weight: 600; color: var(--fs-green-600); text-decoration: none; background: transparent; border: 0; }
.fs-link:hover { color: var(--fs-green-700); }

/* ───────── Pills / badges ───────── */
.fs-pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 10px;
  border-radius: var(--fs-r-full);
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
}
.fs-pill.tone-up { background: oklch(0.93 0.06 145); color: var(--fs-green-700); }
.fs-pill.tone-down { background: var(--fs-amber-bg); color: var(--fs-amber-text); }
.fs-pill.tone-flat { background: var(--fs-rail); color: var(--fs-muted); }
.fs-status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: var(--fs-r-full); white-space: nowrap; }
.fs-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: var(--fs-r-full); }
.fs-badge-on { background: oklch(0.93 0.06 145); color: var(--fs-green-700); }
.fs-badge-off { background: var(--fs-amber-bg); color: var(--fs-amber-text); }

/* ───────── Tabs ───────── */
.fs-tabs {
  display: inline-flex; gap: 2px; padding: 4px;
  background: var(--fs-card);
  border: 1px solid var(--fs-border);
  border-radius: var(--fs-r-full);
  width: fit-content;
}
.fs-tab {
  height: 30px; padding: 0 15px; border: 0; border-radius: var(--fs-r-full);
  font-family: var(--fs-font-display); font-weight: 500; font-size: 12.5px;
  background: transparent; color: var(--fs-muted);
  transition: background var(--fs-t) var(--fs-ease), color var(--fs-t) var(--fs-ease);
}
.fs-tab:hover { color: var(--fs-ink); }
.fs-tab.is-active { background: var(--fs-green-500); color: #fff; box-shadow: var(--fs-shadow-sm); }

/* ───────── Tables ───────── */
.fs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fs-table th {
  text-align: left; font-family: var(--fs-font-display);
  font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--fs-muted); padding: 0 14px 10px;
  border-bottom: 1px solid var(--fs-border);
}
.fs-table td { padding: 12px 14px; border-bottom: 1px solid var(--fs-border-soft); color: var(--fs-ink); vertical-align: middle; }
.fs-table tbody tr:last-child td { border-bottom: none; }
.fs-table tbody tr { transition: background 120ms var(--fs-ease); }
.fs-table tbody tr:hover { background: var(--fs-paper); }
.fs-table-num { font-variant-numeric: tabular-nums; }
.fs-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }
.fs-pager-info { font-size: 13px; color: var(--fs-muted); font-variant-numeric: tabular-nums; }

/* ───────── Inputs ───────── */
.fs-field { display: block; margin-bottom: 14px; }
.fs-field span { display: block; font-family: var(--fs-font); font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: var(--fs-muted); margin-bottom: 6px; }
.fs-field input, .fs-field select, .fs-inline-form input, .fs-inline-form select {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--fs-border); border-radius: var(--fs-r-md);
  background: var(--fs-card); color: var(--fs-ink);
  font: inherit; outline: none;
  transition: border-color var(--fs-t) var(--fs-ease), box-shadow var(--fs-t) var(--fs-ease);
}
.fs-field input:focus, .fs-field select:focus, .fs-inline-form input:focus {
  border-color: var(--fs-green-400);
  box-shadow: 0 0 0 4px oklch(0.85 0.06 145 / 0.4);
}
.fs-field select, .fs-inline-form select { cursor: pointer; }
.fs-field-error { display: block; color: var(--fs-terracotta); font-size: 12.5px; margin-top: 5px; font-style: normal; }
.fs-check { display: flex; gap: 8px; align-items: center; font-size: 13.5px; margin-bottom: 16px; }
.fs-modchips { display: flex; flex-wrap: wrap; gap: 8px; }
.fs-modchip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border: 1px solid var(--fs-border); border-radius: var(--fs-r-full); font-size: 12.5px; font-weight: 600; color: var(--fs-ink-2); cursor: pointer; background: var(--fs-card); }
.fs-modchip:has(input:checked) { border-color: var(--fs-green-500); background: var(--fs-green-tint); color: var(--fs-green-700); }
.fs-modchip input { accent-color: var(--fs-green-600); }
.fs-auth-form { display: flex; flex-direction: column; }
.fs-auth-form .fs-btn { width: 100%; height: 44px; margin-top: 6px; }
.fs-inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fs-inline-form input, .fs-inline-form select { width: auto; }

/* ───────── Stat cards ───────── */
.fs-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 14px; }
.fs-stat { background: var(--fs-card); border: 1px solid var(--fs-border); border-radius: var(--fs-r-lg); padding: 18px 20px; box-shadow: var(--fs-shadow-sm); }
.fs-stat-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--fs-muted); }
.fs-stat-value { display: flex; align-items: baseline; gap: 4px; margin-top: 9px; }
.fs-stat-value b { font-family: var(--fs-font-display); font-size: 28px; font-weight: 600; color: var(--fs-ink); line-height: 1; letter-spacing: -.02em; }
.fs-stat-value i { font-size: 15px; font-weight: 600; color: var(--fs-muted-2); font-style: normal; }

/* ───────── Map ───────── */
.fs-map-card { flex: 3 1 460px; min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.fs-map { position: relative; flex: 1; min-height: 380px; background: #e3e9dd; }
.fs-legend { position: absolute; left: 14px; bottom: 14px; z-index: 500; display: flex; gap: 14px; align-items: center; background: rgba(255,255,255,.94); border: 1px solid var(--fs-border); border-radius: var(--fs-r-md); padding: 8px 12px; font-size: 12.5px; font-weight: 600; color: var(--fs-ink-2); }
.fs-legend span { display: flex; align-items: center; gap: 6px; }
.fs-swatch { width: 11px; height: 11px; border-radius: 50%; }
.fs-pin { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; cursor: pointer; transition: transform .12s ease; }
.fs-pin:hover { transform: scale(1.15); }
.fs-pin.is-healthy { background: var(--fs-green-500); }
.fs-pin.is-attention { background: var(--fs-amber); }
.fs-pin.is-gateway { border-radius: 9px; background: var(--fs-green-900); }

/* ───────── Alerts panel ───────── */
.fs-alerts-card { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; }
.fs-alerts-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px 12px; border-bottom: 1px solid var(--fs-border-soft); }
.fs-alerts-count { background: var(--fs-terracotta); color: #fff; font-size: 12px; font-weight: 700; min-width: 20px; height: 20px; border-radius: var(--fs-r-full); display: grid; place-items: center; padding: 0 6px; }
.fs-alerts-list { display: flex; flex-direction: column; padding: 8px; }
.fs-alert { display: flex; gap: 12px; padding: 13px 12px; border-radius: var(--fs-r-md); cursor: pointer; }
.fs-alert:hover { background: var(--fs-paper); }
.fs-alert-bar { flex: 0 0 4px; align-self: stretch; border-radius: 3px; }
.fs-alert-bar.sev-urgent { background: var(--fs-terracotta); animation: fs-pulse 2.4s infinite; }
.fs-alert-bar.sev-warning { background: var(--fs-amber); }
.fs-alert-bar.sev-info { background: var(--fs-border-strong); }
.fs-alert-top { display: flex; justify-content: space-between; gap: 8px; }
.fs-alert-title { font-size: 14px; font-weight: 700; color: var(--fs-ink); }
.fs-alert-when { font-size: 12px; font-weight: 600; color: var(--fs-muted-2); white-space: nowrap; }
.fs-alert-body { font-size: 13px; color: var(--fs-muted); margin-top: 3px; line-height: 1.45; }
.fs-alerts-foot { margin-top: auto; padding: 11px 18px; border-top: 1px solid var(--fs-border-soft); }

/* ───────── Recommendation strip ───────── */
.fs-rec { border-radius: var(--fs-r-lg); padding: 18px 20px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.fs-rec.is-active { background: var(--fs-shell-grad); }
.fs-rec.is-done { background: var(--fs-green-tint); border: 1px solid var(--fs-green-tint-border); }
.fs-rec-icon { flex: 0 0 auto; width: 50px; height: 50px; border-radius: 13px; display: grid; place-items: center; }
.fs-rec.is-active .fs-rec-icon { background: rgba(255,255,255,.14); color: #cfe3c8; }
.fs-rec.is-done .fs-rec-icon { background: var(--fs-green-600); }
.fs-rec-body { flex: 1 1 280px; min-width: 0; }
.fs-rec-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--fs-green-200); }
.fs-rec-title { font-family: var(--fs-font-display); font-size: 19px; font-weight: 600; color: #fff; margin-top: 3px; letter-spacing: -.2px; }
.fs-rec-sub { font-size: 14px; color: rgba(255,255,255,.82); margin-top: 4px; line-height: 1.45; }
.fs-rec.is-done .fs-rec-title { color: var(--fs-green-900); }
.fs-rec.is-done .fs-rec-sub { color: var(--fs-ink-2); }

/* ───────── Sensor detail modal ───────── */
.fs-modal-scrim { position: fixed; inset: 0; z-index: 1000; background: rgba(13,31,15,.42); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.fs-modal { width: 100%; max-width: 460px; background: var(--fs-card); border: 1px solid var(--fs-border); border-radius: var(--fs-r-xl); overflow: hidden; box-shadow: var(--fs-shadow-xl); animation: fs-pop var(--fs-t) var(--fs-ease); }
.fs-modal-head { padding: 18px 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--fs-border-soft); }
.fs-modal-title { font-family: var(--fs-font-display); font-size: 19px; font-weight: 600; color: var(--fs-ink); }
.fs-modal-meta { font-size: 13px; color: var(--fs-muted); margin-top: 2px; }
.fs-metrics { padding: 18px 20px 4px; }
.fs-metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fs-metric { background: var(--fs-paper); border: 1px solid var(--fs-border-tile); border-radius: var(--fs-r-md); padding: 13px 14px; }
.fs-metric-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--fs-muted); }
.fs-metric-value { font-family: var(--fs-font-display); font-size: 22px; font-weight: 600; color: var(--fs-ink); margin-top: 5px; }
.fs-note { margin: 14px 20px 0; padding: 12px 14px; background: var(--fs-amber-bg); border: 1px solid var(--fs-amber-border); border-radius: var(--fs-r-md); display: flex; gap: 10px; align-items: flex-start; }
.fs-note span { font-size: 13px; color: var(--fs-amber-text); font-weight: 600; line-height: 1.45; }
.fs-modal-foot { padding: 18px 20px; display: flex; gap: 10px; }

/* ───────── Report charts ───────── */
.fs-chart-card { padding: 18px; }
.fs-chart-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.fs-chart-sub { font-size: 13px; color: var(--fs-muted); margin-top: 2px; }
.fs-chart { margin-top: 14px; }
.fs-chart svg { display: block; width: 100%; height: 140px; }
.fs-chart-area { fill: var(--fs-green-tint); }
.fs-chart-line { fill: none; stroke: var(--fs-green-500); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.fs-bars { display: flex; align-items: stretch; gap: 12px; height: 170px; margin-top: 16px; }
.fs-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.fs-bar-val { font-size: 12px; font-weight: 700; color: var(--fs-ink); font-variant-numeric: tabular-nums; }
.fs-bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.fs-bar-fill { width: 100%; max-width: 44px; min-height: 4px; border-radius: 7px 7px 0 0; background: linear-gradient(180deg, var(--fs-green-400), var(--fs-green-600)); }
.fs-bar-label { font-size: 12px; font-weight: 600; color: var(--fs-muted); }

/* ───────── Device list ───────── */
.fs-devices { display: flex; flex-direction: column; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.fs-device-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--fs-card); border: 1px solid var(--fs-border); border-radius: var(--fs-r-md); box-shadow: var(--fs-shadow-sm); }
.fs-device-name { font-weight: 700; color: var(--fs-ink); }
.fs-device-meta { margin-left: auto; font-size: 13px; color: var(--fs-muted); font-variant-numeric: tabular-nums; }

/* ───────── Empty state ───────── */
.fs-empty {
  margin: 40px auto; max-width: 480px; padding: 44px 36px;
  text-align: center; color: var(--fs-muted); font-size: 14px; line-height: 1.55;
  background: var(--fs-card); border: 1px solid var(--fs-border);
  border-radius: var(--fs-r-lg); box-shadow: var(--fs-shadow-sm);
  display: flex; flex-direction: column; gap: 16px; align-items: center;
}
.fs-empty .fs-btn { flex: 0 0 auto; }
.fs-empty-title { font-family: var(--fs-font-display); font-size: 17px; font-weight: 600; color: var(--fs-ink); }
.fs-empty-text { margin: 0; color: var(--fs-muted); max-width: 340px; }

/* ───────── Auth (login) ───────── */
.fs-auth { min-height: 100vh; display: grid; place-items: center; background: var(--fs-shell-grad); padding: 24px; }
.fs-auth-card { width: 360px; max-width: 100%; background: var(--fs-card); border: 1px solid var(--fs-border); border-radius: var(--fs-r-xl); padding: 30px; box-shadow: var(--fs-shadow-xl); }
.fs-auth-brand { font-family: var(--fs-font-display); font-weight: 700; font-size: 20px; color: var(--fs-ink); margin-bottom: 14px; }
.fs-auth-brand span { color: var(--fs-green-500); }
.fs-auth-title { font-family: var(--fs-font-display); font-size: 20px; margin: 0 0 18px; }

/* ───────── Admin back-office ───────── */
.fs-admin-shell { min-height: 100vh; background: var(--fs-shell-grad); background-attachment: fixed; display: flex; flex-direction: column; }
.fs-admin-bar { display: flex; align-items: center; gap: 14px; padding: 14px 24px; color: rgba(255,255,255,0.92); }
.fs-admin-bar .fs-logo-text { color: #fff; }
.fs-admin-bar .fs-link { color: rgba(255,255,255,0.85); }
.fs-admin-bar .fs-link:hover { color: #fff; }
.fs-admin-main { background: var(--fs-paper); border: 1px solid var(--fs-border); border-radius: var(--fs-r-xl); margin: 0 16px 16px; min-height: calc(100vh - 80px); }
.fs-admin-page { max-width: 920px; margin: 0 auto; }
.fs-admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.fs-admin-section { border-top: 1px solid var(--fs-border-soft); padding: 20px 0; }
.fs-admin-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; margin-bottom: 8px;
  border: 1px solid var(--fs-border); border-radius: var(--fs-r-md);
  background: var(--fs-card); box-shadow: var(--fs-shadow-sm);
  text-decoration: none; color: var(--fs-ink);
  transition: border-color var(--fs-t) var(--fs-ease);
}
.fs-admin-row:hover { border-color: var(--fs-green-400); }

/* ───────── Map picker (forms) ───────── */
.fs-map-picker { height: 300px; border-radius: var(--fs-r-md); overflow: hidden; border: 1px solid var(--fs-border); background: #e3e9dd; }
.fs-map-hint { font-size: 12.5px; color: var(--fs-muted); margin: 0 0 6px; }

/* ───────── Map page ───────── */
.fs-mappage { position: relative; height: calc(100vh - 188px); min-height: 460px; border-radius: var(--fs-r-lg); overflow: hidden; border: 1px solid var(--fs-border); box-shadow: var(--fs-shadow-sm); }
/* Full-bleed map: fills the whole content panel (no page header, no padding). */
.fs-main-flush { padding: 0; overflow: hidden; }
.fs-mappage.is-full { height: 91vh; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
.fs-map-draw-btn { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 600; display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: var(--fs-r-full); border: 1px solid var(--fs-border); background: var(--fs-card); color: var(--fs-ink); font-family: var(--fs-font-display); font-weight: 600; font-size: 13px; box-shadow: var(--fs-shadow-md); cursor: pointer; }
.fs-map-draw-btn:hover { border-color: var(--fs-green-400); }
.fs-col { display: flex; flex-direction: column; }
/* Leaflet field-name tooltip */
.fs-poly-label { background: rgba(255,255,255,.92); border: 1px solid var(--fs-border); border-radius: 6px; padding: 1px 8px; font-family: var(--fs-font-display); font-weight: 600; font-size: 11.5px; color: var(--fs-green-900); box-shadow: var(--fs-shadow-sm); }
.fs-poly-label::before { display: none; }
.fs-map-hintbar { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 550; max-width: min(620px, 88%); text-align: center; background: rgba(28,31,26,.84); color: #fff; font-size: 12.5px; line-height: 1.4; padding: 8px 16px; border-radius: var(--fs-r-lg); box-shadow: var(--fs-shadow-md); }
.fs-mappage .fs-map-canvas { position: absolute; inset: 0; background: #e3e9dd; }
.fs-map-panel { position: absolute; top: 14px; right: 14px; width: 300px; max-width: calc(100% - 28px); z-index: 600; background: var(--fs-card); border: 1px solid var(--fs-border); border-radius: var(--fs-r-lg); box-shadow: var(--fs-shadow-lg); padding: 16px 18px; }
.fs-map-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.fs-map-panel h3 { font-family: var(--fs-font-display); font-size: 16px; font-weight: 600; margin: 0; }
.fs-map-panel .fs-map-close { background: none; border: 0; color: var(--fs-muted-2); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px; }
.fs-map-panel .sub { font-size: 12.5px; color: var(--fs-muted); margin: 2px 0 0; }
.fs-map-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.fs-map-metric { background: var(--fs-paper); border: 1px solid var(--fs-border-tile); border-radius: var(--fs-r-sm); padding: 8px 10px; }
.fs-map-metric .l { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--fs-muted); }
.fs-map-metric .v { font-family: var(--fs-font-display); font-size: 18px; font-weight: 600; color: var(--fs-ink); margin-top: 2px; }
.fs-map-legend { position: absolute; left: 14px; bottom: 14px; z-index: 500; display: flex; gap: 14px; align-items: center; background: rgba(255,255,255,.94); border: 1px solid var(--fs-border); border-radius: var(--fs-r-md); padding: 8px 12px; font-size: 12.5px; font-weight: 600; color: var(--fs-ink-2); }
.fs-map-legend span { display: flex; align-items: center; gap: 6px; }

/* ───────── Page header ───────── */
.fs-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.fs-page-head h1 { font-size: 27px; }
.fs-kicker { font-family: var(--fs-font-display); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--fs-green-600); margin-bottom: 7px; }
.fs-page-sub { color: var(--fs-muted); margin: 7px 0 0; font-size: 13.5px; max-width: 64ch; }
.fs-page-actions { display: flex; gap: 8px; flex: 0 0 auto; align-items: center; }

/* ───────── Breadcrumbs (topbar) ───────── */
.fs-crumbs { display: flex; align-items: center; gap: 8px; font-family: var(--fs-font-display); font-size: 13px; color: var(--fs-muted); }
.fs-crumbs .sep { color: var(--fs-muted-2); display: inline-flex; }
.fs-crumbs .current { color: var(--fs-ink); font-weight: 600; }

/* ───────── List rows (fields / sensors / admin) ───────── */
.fs-list { display: flex; flex-direction: column; gap: 8px; }
.fs-list-row {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px;
  background: var(--fs-card); border: 1px solid var(--fs-border);
  border-radius: var(--fs-r-md); box-shadow: var(--fs-shadow-sm);
  text-decoration: none; color: var(--fs-ink);
  transition: border-color var(--fs-t) var(--fs-ease), box-shadow var(--fs-t) var(--fs-ease);
}
.fs-list-row:hover { border-color: var(--fs-green-400); box-shadow: var(--fs-shadow-md); }
.fs-list-ico { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 11px; background: var(--fs-green-tint); color: var(--fs-green-700); display: grid; place-items: center; }
.fs-list-main { flex: 1; min-width: 0; }
.fs-list-title { font-weight: 700; color: var(--fs-ink); }
.fs-list-sub { font-size: 12.5px; color: var(--fs-muted); margin-top: 2px; }
.fs-list-meta { margin-left: auto; font-size: 13px; color: var(--fs-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fs-list-chev { flex: 0 0 auto; color: var(--fs-muted-2); display: inline-flex; }

/* ───────── Compact in-card item list ───────── */
.fs-itemlist { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; }
.fs-itemlist li { display: flex; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--fs-border-soft); font-size: 13.5px; color: var(--fs-ink); }
.fs-itemlist li:last-child { border-bottom: none; }
.fs-itemlist li b { font-weight: 600; }
.fs-itemlist .meta { margin-left: auto; color: var(--fs-muted); font-size: 12.5px; }
.fs-itemlist-empty { color: var(--fs-muted-2); font-size: 13px; padding: 4px 2px 14px; }

/* ───────── Card section head ───────── */
.fs-section-head { margin-bottom: 16px; }
.fs-section-head h2 { font-size: 17px; }
.fs-section-head p { margin: 4px 0 0; font-size: 13px; color: var(--fs-muted); }
.fs-form-card { padding: 22px 24px; }

/* ───────── Responsive: off-canvas sidebar < 940px ───────── */
@media (max-width: 940px) {
  .fs-app { grid-template-columns: 1fr; grid-template-areas: "banner" "topbar" "main"; }
  .fs-hamburger { display: inline-flex; }
  .fs-synced { display: none; }
  .fs-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 256px; z-index: 60;
    transform: translateX(-110%); transition: transform .25s var(--fs-ease);
  }
  .fs-sidebar.is-open { transform: translateX(0); box-shadow: 0 12px 40px rgba(0,0,0,.4); }
  .fs-topbar, .fs-main { margin-left: 12px; }
  .fs-scrim.is-open { display: block; }
}
