/* app.css — RaDa Intelligence web platform chrome (Chemeli daylight).
   Builds on chemeli.css tokens. Cream paper surfaces, warm orange accent,
   traffic-light status family. Desktop-rich, mobile-responsive. */

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-display); color: var(--ink);
  background:
    radial-gradient(1200px 700px at 16% -10%, #F8F2E6, transparent 60%),
    radial-gradient(1000px 800px at 112% 120%, #ECE3D2, transparent 55%),
    var(--bg-cream);
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--orange-soft); }
.mono { font-family: var(--font-mono); }
.fig { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }

/* ---------- macOS window ---------- */
.win { position: fixed; inset: 16px; border-radius: 16px; background: var(--bg-cream);
  box-shadow: 0 30px 80px rgba(20,15,5,.30), 0 2px 0 rgba(255,255,255,.6) inset;
  display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); }
.titlebar { height: 38px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 14px;
  background: linear-gradient(#F4EEE1, #EDE5D5); border-bottom: 1px solid var(--line); position: relative; }
.lights { display: flex; gap: 8px; }
.light { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.10); }
.light.r { background: #ED6A5E; } .light.y { background: #F4BE4F; } .light.g { background: #61C554; }
.titlebar .title { position: absolute; left: 0; right: 0; text-align: center; font-size: 12.5px; color: var(--ink-soft); font-weight: 500; pointer-events: none; }
.titlebar .ver { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-mute); letter-spacing: .4px; z-index: 1; }
.demotag { z-index: 1; margin-left: auto; font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--amber-ink); background: var(--amber-soft); border: 1px solid var(--amber); border-radius: var(--r-pill); padding: 2px 9px; white-space: nowrap; cursor: help; }
.demotag + .ver { margin-left: 10px; }

/* ---------- toolbar ---------- */
.toolbar { height: 60px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: var(--bg-paper); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; padding-right: 15px; border-right: 1px solid var(--line); }
.brand img { width: 32px; height: 32px; border-radius: 8px; display: block; background: #fff; border: 1px solid var(--line); }
.brand .nm { font-weight: 700; font-size: 15px; letter-spacing: -.3px; line-height: 1.05; }
.brand .sub { font-size: 9.5px; color: var(--ink-mute); font-family: var(--font-mono); letter-spacing: .6px; text-transform: uppercase; }
.spacer { flex: 1; }

.search { display: flex; align-items: center; gap: 9px; background: var(--bg-cream-dim); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 8px 15px; width: 300px; color: var(--ink-mute); }
.search input { border: 0; background: transparent; outline: none; font-family: inherit; font-size: 13px; color: var(--ink); width: 100%; }
.search input::placeholder { color: var(--ink-mute); }

.eyebrow { font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink-mute); display: inline-flex; align-items: center; gap: 7px; }
.eb-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }

/* buttons */
.btn { border: 1px solid var(--line); background: var(--bg-paper); color: var(--ink); border-radius: var(--r-pill);
  padding: 8px 15px; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; transition: .12s; }
.btn:hover { background: var(--bg-cream-dim); }
.btn.orange { background: var(--orange); border-color: var(--orange-deep); color: #3a2408; font-weight: 600; }
.btn.orange:hover { background: #e6a55e; }
.btn.green { background: var(--green); border-color: var(--green-deep); color: #fff; font-weight: 600; }
.btn.dark { background: var(--forest); border-color: var(--forest); color: var(--ink-on-dark); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn.ghost:hover { background: var(--bg-cream-dim); color: var(--ink); }
.btn.sm { padding: 5px 11px; font-size: 12px; }
.icon-btn { width: 38px; height: 38px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--bg-paper);
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink-soft); position: relative; }
.icon-btn:hover { background: var(--bg-cream-dim); color: var(--ink); }
.icon-btn .badge { position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); border: 1.5px solid var(--bg-paper); }

/* language toggle */
.lang { display: inline-flex; background: var(--bg-cream-dim); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px; gap: 2px; }
.lang button { border: 0; background: transparent; color: var(--ink-mute); font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .5px; padding: 5px 11px; border-radius: var(--r-pill); }
.lang button.on { background: var(--bg-paper); color: var(--ink); box-shadow: var(--shadow-1); }

/* seat / role switcher */
.seat { position: relative; }
.seat-btn { border: 1px solid var(--line); background: var(--bg-cream-dim); border-radius: var(--r-pill);
  padding: 5px 12px 5px 10px; display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink); font-weight: 500; }
.seat-btn:hover { background: var(--bg-paper); }
.seat-btn .who { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-mute); }
.seat-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); flex: none; }
.seat-menu { position: absolute; top: 42px; right: 0; z-index: 80; width: 300px; background: var(--bg-paper);
  border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-3); padding: 6px; }
.seat-opt { display: flex; align-items: flex-start; gap: 10px; padding: 10px 11px; border-radius: var(--r-sm); cursor: pointer; }
.seat-opt:hover { background: var(--bg-cream-dim); }
.seat-opt.on { background: var(--orange-soft); }
.seat-opt .nm { font-size: 13px; font-weight: 600; color: var(--ink); }
.seat-opt .sb { font-size: 11px; color: var(--ink-mute); line-height: 1.35; margin-top: 2px; }

/* ---------- body: nav rail + main ---------- */
.body { flex: 1; display: flex; min-height: 0; }
.nav { flex: none; width: 84px; background: var(--bg-paper); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; padding: 12px 0; gap: 3px; }
.nav-item { width: 68px; padding: 9px 0 7px; border-radius: var(--r-md); display: flex; flex-direction: column; align-items: center; gap: 5px;
  color: var(--ink-mute); cursor: pointer; transition: .12s; border: 1px solid transparent; }
.nav-item span { font-size: 10px; font-weight: 600; letter-spacing: .1px; text-align: center; line-height: 1.1; }
.nav-item:hover { background: var(--bg-cream-dim); color: var(--ink-soft); }
.nav-item.on { background: var(--orange-soft); color: var(--orange-deep); }
.nav-sep { width: 40px; height: 1px; background: var(--line); margin: 7px 0; }
.nav-spacer { flex: 1; }
.nav-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--forest); color: var(--orange);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; font-family: var(--font-mono); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.scroll { overflow-y: auto; overflow-x: hidden; flex: 1; min-height: 0; }
.scroll::-webkit-scrollbar { width: 10px; }
.scroll::-webkit-scrollbar-thumb { background: rgba(20,15,5,.16); border-radius: 9px; border: 2px solid var(--bg-cream); }

/* page header */
.phead { padding: 22px 28px 16px; display: flex; align-items: flex-end; gap: 16px; }
.phead h1 { font-family: var(--font-display); font-size: 27px; font-weight: 700; letter-spacing: -.7px; margin: 6px 0 0; line-height: 1.05; }
.phead .psub { font-size: 13.5px; color: var(--ink-soft); margin-top: 4px; }
.phead .pright { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* cards */
.card { background: var(--bg-paper); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card.sel { border-color: var(--orange); box-shadow: var(--shadow-2); }
.card-pad { padding: 18px 20px; }
.card-title { font-size: 15px; font-weight: 600; letter-spacing: -.2px; }

/* status chip + dot */
.sdot { display: inline-block; border-radius: 50%; flex: none; }
.schip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: .4px; text-transform: uppercase; padding: 3px 9px 3px 8px; border-radius: var(--r-pill); }
.bar { width: 100%; border-radius: 99px; overflow: hidden; }

/* pill / tag */
.tag { font-family: var(--font-mono); font-size: 10px; padding: 2px 8px; border-radius: var(--r-sm); background: var(--bg-cream-dim); color: var(--ink-soft); font-weight: 500; letter-spacing: .3px; }

/* segmented */
.seg { display: inline-flex; background: var(--bg-cream-dim); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--ink-soft); font-size: 12px; font-weight: 500; padding: 5px 13px; border-radius: var(--r-pill); display: flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--bg-paper); color: var(--ink); box-shadow: var(--shadow-1); }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 99px; background: var(--bg-cream-dim); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--orange); border: 2px solid #fff; box-shadow: var(--shadow-1); cursor: pointer; }

/* ============ TRIAGE ============ */
.triage { padding: 0 28px 28px; display: flex; flex-direction: column; gap: 16px; }

/* weather banner */
.wx { display: flex; align-items: stretch; gap: 0; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line);
  background: linear-gradient(110deg, #F6C98A 0%, #EBB36B 22%, #D9D6C0 56%, #BFD3DA 100%); box-shadow: var(--shadow-1); }
.wx-left { padding: 16px 22px; display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 300px; }
.wx-left .eyebrow { color: #6E4710; }
.wx-left .hl { font-size: 16px; font-weight: 600; color: #3a2408; line-height: 1.25; letter-spacing: -.2px; max-width: 340px; }
.wx-left .loc { font-size: 12px; color: #6b5a3a; font-family: var(--font-mono); }
.wx-days { flex: 1; display: flex; align-items: stretch; }
.wx-day { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 12px 4px;
  border-left: 1px solid rgba(255,255,255,.35); color: #3a2c12; }
.wx-day .d { font-family: var(--font-mono); font-size: 10px; letter-spacing: .5px; text-transform: uppercase; opacity: .8; }
.wx-day .g { font-size: 20px; line-height: 1; }
.wx-day .t { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wx-day .mm { font-size: 10px; color: #1F4459; font-weight: 600; }

/* count cards */
.counts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.count { background: var(--bg-paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.count .n { font-size: 30px; font-weight: 700; letter-spacing: -1px; line-height: 1; font-variant-numeric: tabular-nums; }
.count .l { font-size: 11.5px; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }

/* triage split */
.tsplit { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 16px; align-items: start; }
@media (max-width: 1120px) { .tsplit { grid-template-columns: 1fr; } }

.feed-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 12px; }
.feed { display: flex; flex-direction: column; gap: 9px; }
.frow { display: grid; grid-template-columns: 8px 1fr auto; gap: 14px; align-items: center; padding: 13px 16px 13px 14px;
  background: var(--bg-paper); border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; transition: .12s; position: relative; }
.frow:hover { background: var(--bg-cream-dim); border-color: var(--line); transform: translateX(2px); }
.frow .stripe { position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 99px; }
.frow .fname { font-size: 14.5px; font-weight: 600; letter-spacing: -.2px; }
.frow .fmeta { font-size: 11.5px; color: var(--ink-mute); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.frow .fdriver { display: flex; align-items: center; gap: 7px; margin-top: 7px; font-size: 12.5px; color: var(--ink-soft); }
.frow .fdriver .gl { font-size: 14px; }
.frow .fright { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.frow .visit { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-mute); }
.pulse { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(192,73,43,.0); } 50% { box-shadow: 0 0 0 4px rgba(192,73,43,.14); } }

/* ============ MAP ============ */
.mapwrap { position: relative; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-1); background: #DDE3CF; }
.mapwrap.sticky { position: sticky; top: 8px; }
.map-overlay { position: absolute; left: 14px; top: 14px; z-index: 4; display: flex; flex-direction: column; gap: 8px; }
.map-legend { background: rgba(252,247,236,.92); backdrop-filter: blur(4px); border: 1px solid var(--line); border-radius: var(--r-md); padding: 9px 11px; box-shadow: var(--shadow-1); }
.map-legend .row { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-soft); margin: 3px 0; }
.map-title { position: absolute; right: 14px; top: 14px; z-index: 4; background: rgba(252,247,236,.92); backdrop-filter: blur(4px); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 6px 13px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--ink-soft); box-shadow: var(--shadow-1); }
.pin { cursor: pointer; }
.pin .ring { transition: .15s; }
.pin:hover .ring { stroke-width: 3; }
.maptip { position: absolute; z-index: 6; background: var(--bg-paper); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-2); padding: 9px 12px; min-width: 150px; pointer-events: none; transform: translate(-50%, calc(-100% - 14px)); }
.maptip .mt-name { font-size: 13px; font-weight: 600; }
.maptip .mt-meta { font-size: 11px; color: var(--ink-mute); margin-top: 2px; }

/* ============ FARM DETAIL ============ */
.fd { padding: 0 28px 28px; }
.fd-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .fd-grid { grid-template-columns: 1fr; } }
.metric { display: flex; flex-direction: column; gap: 7px; }
.metric .top { display: flex; align-items: baseline; justify-content: space-between; }
.metric .mlabel { font-size: 12.5px; color: var(--ink-soft); display: flex; align-items: center; gap: 7px; }
.metric .mverdict { font-size: 13.5px; font-weight: 600; }
.metric .mraw { font-family: var(--font-mono); font-size: 11px; color: var(--ink-mute); }

/* phenology timeline */
.pheno { display: flex; align-items: stretch; gap: 0; margin-top: 14px; position: relative; }
.pstage { flex: 1; position: relative; text-align: center; padding-top: 26px; }
.pstage .pseg { position: absolute; top: 9px; left: 0; right: 0; height: 5px; background: var(--bg-cream-dim); }
.pstage:first-child .pseg { border-radius: 99px 0 0 99px; } .pstage:last-child .pseg { border-radius: 0 99px 99px 0; }
.pstage.done .pseg { background: var(--green); } .pstage.cur .pseg { background: linear-gradient(90deg, var(--green), var(--orange)); }
.pstage .pdot { position: absolute; top: 5px; left: 50%; transform: translateX(-50%); width: 13px; height: 13px; border-radius: 50%; background: var(--bg-paper); border: 2px solid var(--bg-cream-dim); z-index: 2; }
.pstage.done .pdot { background: var(--green); border-color: var(--green); }
.pstage.cur .pdot { background: var(--orange); border-color: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft); }
.pstage .plabel { font-size: 11px; color: var(--ink-mute); font-weight: 500; }
.pstage.cur .plabel { color: var(--orange-deep); font-weight: 600; }
.pstage.done .plabel { color: var(--ink-soft); }

/* raw data drawer */
.drawer { border-top: 1px dashed var(--line); margin-top: 4px; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px 0 4px; cursor: pointer; }
.drawer-head .chev { transition: .15s; color: var(--ink-mute); }
.drawer-head.open .chev { transform: rotate(90deg); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.kv .k { color: var(--ink-mute); } .kv .v { font-family: var(--font-mono); color: var(--ink); }

/* visit log */
.visit { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.visit .vrail { display: flex; flex-direction: column; align-items: center; }
.visit .vnode { width: 10px; height: 10px; border-radius: 50%; background: var(--green); border: 2px solid var(--green-soft); flex: none; margin-top: 4px; }
.visit .vstem { width: 2px; flex: 1; background: var(--line); margin-top: 4px; }
.visit .vdate { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-mute); }
.visit .vnote { font-size: 13px; margin-top: 3px; }
.visit .vadvice { font-size: 12px; color: var(--ink-soft); margin-top: 4px; font-style: italic; }
.photo-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--ink-mute); font-family: var(--font-mono); margin-top: 6px; }

/* recommended action */
.rec { background: var(--orange-soft); border: 1px solid var(--orange); border-radius: var(--r-md); padding: 14px 16px; }
.rec .rh { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--orange-deep); display: flex; align-items: center; gap: 7px; }
.rec .rt { font-size: 14.5px; color: #3a2408; line-height: 1.4; margin-top: 7px; font-weight: 500; }

/* ============ COOP ============ */
.coop { padding: 0 28px 28px; display: flex; flex-direction: column; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.kpi { background: var(--bg-paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; }
.kpi .n { font-size: 32px; font-weight: 700; letter-spacing: -1.2px; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 11.5px; color: var(--ink-soft); margin-top: 6px; display: flex; align-items: center; gap: 7px; }
.coop-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .coop-grid { grid-template-columns: 1fr; } }

/* stacked health bar */
.stack { display: flex; height: 16px; border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.stack > div { height: 100%; }

/* simple table */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-family: var(--font-mono); font-size: 10px; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-mute); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.you td { background: var(--orange-soft); }
.tbl .nm { font-weight: 600; }

/* bars row */
.brow { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.brow .bl { font-size: 13px; width: 150px; flex: none; }
.brow .bv { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); width: 56px; text-align: right; flex: none; }

.empty { padding: 40px; text-align: center; color: var(--ink-mute); }
