/* Shared tokens + chrome for the HerdTag dashboards (farmer / ops / trial / explore). */
:root {
  color-scheme: light;
  --page: #f9f9f7; --surface: #fcfcfb; --surface-2: #f3f2ee;
  --ink: #0b0b0b; --ink-2: #52514e; --muted: #6f6d68;
  --grid: #e1e0d9; --axis: #c3c2b7; --border: rgba(11,11,11,0.10);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a;
  --good: #0ca30c; --warn: #fab219; --serious: #ec835a; --critical: #d03b3b; --unknown: #898781; --nodata: #e1e0d9;
  --good-ink: #006300; --critical-ink: #b42f2f;
  --seq-1: #cde2fb; --seq-2: #86b6ef; --seq-3: #3987e5; --seq-4: #1c5cab; --seq-5: #0d366b;
  --accent: #2f6b3a;
  --radius: 10px;
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232321;
    --ink: #f0efec; --ink-2: #c3c2b7; --muted: #9a988f;
    --grid: #2c2c2a; --axis: #383835; --border: rgba(255,255,255,0.10);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70;
    --nodata: #2c2c2a; --good-ink: #0ca30c; --critical-ink: #e66767; --accent: #7cc48a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232321;
  --ink: #f0efec; --ink-2: #c3c2b7; --muted: #9a988f;
  --grid: #2c2c2a; --axis: #383835; --border: rgba(255,255,255,0.10);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70;
  --nodata: #2c2c2a; --good-ink: #0ca30c; --critical-ink: #e66767; --accent: #7cc48a;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); }
a { color: inherit; }

/* nav strip shared by every page */
.navstrip { display: flex; gap: 2px; align-items: center; padding: 0 12px; height: 40px; background: var(--surface);
            border-bottom: 1px solid var(--border); overflow-x: auto; white-space: nowrap; }
.navstrip .brand { font-weight: 650; margin-right: 10px; }
.navstrip a { text-decoration: none; color: var(--ink-2); padding: 6px 10px; border-radius: 6px; font-size: 13px; }
.navstrip a:hover { background: var(--surface-2); }
.navstrip a[aria-current="page"] { color: var(--ink); background: var(--surface-2); font-weight: 600; }
.navstrip .right { margin-left: auto; color: var(--muted); font-size: 12px; padding-left: 12px; }

main { max-width: 1280px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 4px 0 2px; }
.lede { color: var(--ink-2); margin: 0 0 14px; max-width: 70ch; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(12, 1fr); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.card h2 { font-size: 15px; margin: 0 0 2px; }
.card .sub { color: var(--muted); font-size: 12px; margin: 0 0 10px; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; }
@media (max-width: 900px) { .grid > * { grid-column: span 12 !important; } }

.filters { display: flex; gap: 8px; align-items: center; margin: 0 0 14px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { font: inherit; font-size: 13px; border: 0; background: none; color: var(--ink-2); padding: 6px 12px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.btn { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border);
       background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-block; }

.stats { display: flex; gap: 24px; flex-wrap: wrap; }
.stat .v { font-size: 26px; font-weight: 650; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: 12px; }

.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-2); margin: 0 0 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.key-rect { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.key-line { width: 14px; height: 2px; border-radius: 1px; display: inline-block; }
.key-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.chart { position: relative; width: 100%; }
.chart svg { display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .mark, .chart .mark.hover { filter: brightness(1.12); }
.chart .ref { stroke: var(--ink-2); stroke-dasharray: 4 3; stroke-width: 1; }
.chart .reflabel { fill: var(--ink-2); }
.dim { opacity: .55; transition: opacity .2s; }

.tooltip { position: fixed; z-index: 50; pointer-events: none; background: var(--surface); color: var(--ink);
           border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12px;
           box-shadow: 0 6px 20px rgba(0,0,0,.18); min-width: 120px; display: none; }
.tooltip .tt-title { color: var(--muted); margin-bottom: 4px; }
.tooltip .tt-row { display: flex; align-items: center; gap: 8px; }
.tooltip .tt-row b { font-variant-numeric: tabular-nums; }
.tooltip .tt-row span.n { color: var(--ink-2); }

details.table { margin-top: 8px; font-size: 12px; }
details.table summary { color: var(--muted); cursor: pointer; }
details.table .wrap { overflow-x: auto; max-height: 320px; }
table.data { border-collapse: collapse; width: 100%; margin-top: 6px; }
table.data th, table.data td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data th { color: var(--muted); font-weight: 500; position: sticky; top: 0; background: var(--surface); }

.status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 1px 8px 1px 6px; border-radius: 99px;
          border: 1px solid var(--border); white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--unknown)); }

.gap-note { border: 1px dashed var(--axis); border-radius: 8px; padding: 10px 12px; color: var(--ink-2); font-size: 12px; background: var(--surface-2); }
.gap-note b { color: var(--ink); }
.synthetic { font-size: 12px; color: var(--muted); }
.map { height: 360px; border-radius: 8px; overflow: hidden; }
