/* field-mobile.css — shared field UI vocabulary for the Time panel.
 *
 * One sheet, two web roots. Canonical copy: crew-exchange/css/field-mobile.css.
 * Served mirror for the PM app: Project_Management/css/field-mobile.css
 * (run `node scripts/sync-time-panel.mjs` after editing). The values here are
 * the Jarvis Board mobile shell's (css/jarvis-mobile.css) — page #f4f4f4, white
 * cards radius 16 with the two-layer shadow, 12px action tiles, Arial 800
 * uppercase tracked labels, 999px pill buttons — so a super sees the same
 * surface whether the Time panel opens inside Jarvis or in the crew app.
 * Classes are prefixed fm- so the sheet can load next to jarvis-mobile.css
 * without redefining anything.
 */

.fm, .fm * { box-sizing: border-box; }
.fm {
  font-family: "neue-haas-grotesk-text", Arial, Helvetica, sans-serif;
  color: #202020;
  font-size: 14px;
  line-height: 1.35;
  -webkit-tap-highlight-color: transparent;
}
.fm button { font-family: inherit; }
.fm [hidden] { display: none !important; }

/* ── Type ──────────────────────────────────────────────────────────────── */
.fm-kicker {
  font: 700 10px Arial, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8a8f96;
}
.fm-h2 {
  margin: 4px 0 2px;
  font: 800 22px/1.15 "neue-haas-grotesk-display", Arial, sans-serif;
}
.fm-sub { margin: 0; font-size: 12px; color: #8a8f96; }
.fm-lbl {
  display: block;
  font: 800 10px Arial, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8a8f96;
  margin-bottom: 6px;
}
.fm-sec {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 14px 2px 8px;
}
.fm-sec b {
  font: 800 11px Arial, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.fm-sec span { font-size: 11px; color: #8a8f96; }
.fm-muted { color: #8a8f96; font-size: 12px; }
.fm-empty { padding: 28px 8px; text-align: center; color: #8a8f96; font-size: 13px; }
.fm-spin { padding: 18px 8px; text-align: center; color: #8a8f96; font-size: 13px; }

/* ── Stats / KPI tiles ────────────────────────────────────────────────── */
.fm-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}
.fm-stats.is-2 { grid-template-columns: 1fr 1fr; }
.fm-stat {
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  border: 0;
  text-align: left;
  color: inherit;
  min-width: 0;
}
button.fm-stat { cursor: pointer; }
.fm-stat em {
  display: block;
  font: 800 10px Arial, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8a8f96;
  font-style: normal;
}
.fm-stat b { display: block; margin-top: 4px; font-size: 16px; }
.fm-stat.is-bad b { color: #E92A2C; }
.fm-stat.is-ok b { color: #1f7a3f; }

/* ── Action tiles (the Text / Flag / Lodging / Time row) ──────────────── */
.fm-acts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 12px;
}
.fm-acts.is-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fm-acts.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fm-act {
  width: 100%;
  min-width: 0;
  min-height: 58px;
  padding: 8px 2px 7px;
  border: 1px solid #202020;
  border-radius: 12px;
  background: #fff;
  color: #202020;
  font: 800 9px/1.1 Arial, sans-serif;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.fm-act-ico { width: 22px; height: 22px; display: grid; place-items: center; }
.fm-act-ico svg { width: 20px; height: 20px; display: block; }
.fm-act.is-on { background: #202020; color: #fff; }
.fm-act.is-signal { border-color: #E92A2C; color: #E92A2C; }
.fm-act:disabled { opacity: .45; cursor: default; }

/* ── Cards ─────────────────────────────────────────────────────────────── */
.fm-card {
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(32,32,32,.12), 0 6px 14px rgba(32,32,32,.12);
  color: inherit;
}
.fm-card.is-flat { box-shadow: none; border: 1px solid rgba(32,32,32,.08); }
.fm-card.is-flagged { box-shadow: 0 0 0 1.5px #E92A2C, 0 6px 14px rgba(32,32,32,.12); }
.fm-card-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.fm-card-hd b, .fm-card-title { display: block; font-size: 16px; font-weight: 800; }
.fm-card-hd span, .fm-card-sub { display: block; font-size: 12px; color: #6b7076; margin-top: 3px; }
.fm-card-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; font-size: 12px; color: #6b7076; }

/* ── Rows (people / punches) ──────────────────────────────────────────── */
.fm-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid rgba(32,32,32,.06);
  background: none;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  width: 100%;
  text-align: left;
  color: inherit;
}
.fm-row:first-child { border-top: 0; }
button.fm-row { cursor: pointer; }
.fm-av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #202020;
  color: #fff;
  display: grid;
  place-items: center;
  font: 800 11px Arial, sans-serif;
  flex: 0 0 auto;
}
.fm-av > span { display: contents; }
.fm-av svg { width: 18px; height: 18px; display: block; }
.fm-av.is-live { background: #1f7a3f; }
.fm-av.is-off { background: #e6e6e6; color: #8a8f96; }
.fm-av.is-empty { background: #fff; color: #E92A2C; border: 1.5px solid #E92A2C; }
.fm-row-main { flex: 1; min-width: 0; }
.fm-row-main b { display: block; font-size: 14px; }
.fm-row-main span { display: block; font-size: 11px; color: #8a8f96; margin-top: 2px; }
.fm-row-side { flex: 0 0 auto; text-align: right; }
.fm-row-side b { display: block; font-size: 15px; font-weight: 800; }
.fm-row-side span { display: block; font-size: 11px; color: #8a8f96; margin-top: 2px; }
.fm-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #202020;
  flex: 0 0 auto;
  background: #fff;
}
.fm-row.is-on .fm-check { background: #202020; box-shadow: inset 0 0 0 5px #fff; }
.fm-row.is-dim { opacity: .5; }

/* ── Chips / badges ───────────────────────────────────────────────────── */
.fm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fm-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: #f0f0f0;
  color: #404040;
  font: 800 10px Arial, sans-serif;
  letter-spacing: .03em;
  white-space: nowrap;
}
.fm-chip.is-live { background: #e5f6ec; color: #1f7a3f; }
.fm-chip.is-flag, .fm-chip.is-risk { background: #fde8e8; color: #A71F23; }
.fm-chip.is-note, .fm-chip.is-warn { background: #fff2a8; color: #5d4a00; }
.fm-chip.is-dark { background: #202020; color: #fff; }

/* ── Segmented pills ──────────────────────────────────────────────────── */
.fm-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0 10px;
}
.fm-pills::-webkit-scrollbar { display: none; }
.fm-pill {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #202020;
  background: #fff;
  color: #202020;
  font: 700 12px Arial, sans-serif;
  cursor: pointer;
  white-space: nowrap;
}
.fm-pill.is-on { background: #202020; color: #fff; }
.fm-pill .fm-n { margin-left: 6px; font-weight: 800; color: #E92A2C; }
.fm-pill.is-on .fm-n { color: #ffb4b4; }

/* ── Fields ───────────────────────────────────────────────────────────── */
.fm-field { margin: 0 0 12px; }
.fm-field label { display: block; font: 800 10px Arial, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #8a8f96; margin-bottom: 6px; }
.fm-in, .fm-ta, .fm-sel,
.fm-field input, .fm-field textarea, .fm-field select {
  width: 100%;
  border: 1px solid rgba(32,32,32,.12);
  border-radius: 10px;
  background: #f7f7f7;
  padding: 10px 12px;
  font: 14px Arial, sans-serif;
  color: #202020;
  min-height: 44px;
}
.fm-ta { min-height: 88px; resize: vertical; }
.fm-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fm-choice { display: flex; flex-wrap: wrap; gap: 8px; }
.fm-choice button {
  height: 34px;
  padding: 0 12px;
  border: 1px solid #202020;
  border-radius: 999px;
  background: #fff;
  font: 700 12px Arial, sans-serif;
  cursor: pointer;
}
.fm-choice button.is-on { background: #202020; color: #fff; }
.fm-hits { display: grid; gap: 4px; margin-top: 6px; }
.fm-hit {
  min-height: 44px;
  text-align: left;
  border: 1px solid rgba(32,32,32,.12);
  border-radius: 10px;
  background: #fff;
  padding: 8px 12px;
  font: 14px Arial, sans-serif;
  cursor: pointer;
}
.fm-warn {
  background: #fff2a8;
  color: #5d4a00;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  margin-top: 6px;
}
.fm-note {
  background: #fff6f6;
  border: 1px solid rgba(233,42,44,.16);
  color: #8e1b1d;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.fm-go, .fm-ghost, .fm-danger {
  flex: 1;
  height: 48px;
  min-width: 0;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  font: 800 14px Arial, sans-serif;
  cursor: pointer;
}
.fm-go { background: #202020; color: #fff; }
.fm-go:disabled { background: #e6e6e6; color: #8a8f96; cursor: default; }
.fm-ghost { background: #fff; color: #202020; box-shadow: inset 0 0 0 1px #d8d8d8; }
.fm-danger { background: #fff; color: #A71F23; box-shadow: inset 0 0 0 1px #A71F23; }
.fm-go.is-sm, .fm-ghost.is-sm, .fm-danger.is-sm { height: 36px; font-size: 12px; padding: 0 12px; flex: 0 0 auto; }
.fm-btns { display: flex; gap: 10px; margin-top: 12px; }
.fm-foot {
  position: sticky;
  bottom: 0;
  margin: 0 -16px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent, #fff 28%);
  display: flex;
  gap: 10px;
}

/* ── Selection bar (multi-select proxy clock-in) ──────────────────────── */
.fm-selbar {
  position: sticky;
  bottom: 0;
  margin: 8px -16px 0;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: #202020;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 20px 20px 0 0;
}
.fm-selbar b { flex: 1; font: 800 13px Arial, sans-serif; letter-spacing: .04em; text-transform: uppercase; }
.fm-selbar .fm-go { background: #E92A2C; flex: 0 0 auto; height: 40px; }
.fm-selbar .fm-ghost { background: transparent; color: #e6e6e6; box-shadow: inset 0 0 0 1px rgba(230,230,230,.3); flex: 0 0 auto; height: 40px; }

/* ── More grid (bottom-sheet launcher) ────────────────────────────────── */
.fm-more-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px 8px;
  padding: 4px 0 2px;
}
.fm-more-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px 6px;
  border: 0;
  background: none;
  color: #202020;
  cursor: pointer;
  text-decoration: none;
}
.fm-more-ico {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #f0f0f0;
  color: #202020;
  display: grid;
  place-items: center;
}
.fm-more-ico svg { width: 22px; height: 22px; display: block; }
.fm-more-item > span:last-child {
  font: 800 10px/1.15 Arial, sans-serif;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.fm-more-item:active .fm-more-ico { background: #202020; color: #fff; }

/* ── Sheets (crew app; Jarvis supplies its own #jm-sheet chrome) ─────── */
.fm-sheet {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: rgba(32,32,32,.46);
}
.fm-sheet.is-full { justify-content: stretch; background: #fff; }
.fm-sheet-top { flex: 1 1 auto; min-height: 64px; border: 0; background: transparent; cursor: pointer; }
.fm-sheet.is-full .fm-sheet-top { flex: 0 0 auto; min-height: 20px; background: #202020; padding-top: env(safe-area-inset-top, 0px); }
.fm-sheet-card {
  flex: 0 1 auto;
  max-height: 88vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 8px 16px 0;
  overflow: hidden;
  animation: fm-dock-up .22s ease-out;
}
.fm-sheet.is-full .fm-sheet-card { flex: 1; max-height: none; margin-top: -2px; padding-top: 10px; }
.fm-sheet-handle { width: 36px; height: 4px; border-radius: 999px; background: #d4d4d4; margin: 2px auto 6px; }
.fm-sheet-hd {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 6px 0 12px;
}
.fm-sheet-hd h2 { margin: 4px 0 2px; font: 800 22px/1.15 "neue-haas-grotesk-display", Arial, sans-serif; }
.fm-sheet-hd p { margin: 0; font-size: 12px; color: #8a8f96; }
.fm-x {
  width: 36px;
  height: 36px;
  border: 0;
  background: none;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: #202020;
  flex: 0 0 auto;
}
.fm-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}
@keyframes fm-dock-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ── Time panel specifics ─────────────────────────────────────────────── */
.fm-time-hd { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.fm-time-hd .fm-h2 { margin: 0; }
.fm-live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #1f7a3f; margin-right: 6px; vertical-align: 1px; }
.fm-hours { font: 800 21px/1 "neue-haas-grotesk-display", Arial, sans-serif; }
.fm-hours small { font: 700 11px Arial, sans-serif; color: #8a8f96; margin-left: 4px; }
.fm-timeline { display: flex; gap: 6px; align-items: center; font-size: 12px; color: #6b7076; margin-top: 4px; flex-wrap: wrap; }
.fm-ts-preview { width: 100%; border-radius: 12px; display: block; background: #f0f0f0; max-height: 46vh; object-fit: contain; }
.fm-ts-row { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid rgba(32,32,32,.06); }
.fm-ts-row input[type="time"] { min-height: 36px; padding: 4px 8px; font-size: 13px; width: 100%; }
.fm-ts-times { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.fm-ts-row.is-off { opacity: .5; }

/* ── Toast ────────────────────────────────────────────────────────────── */
.fm-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 200;
  background: #202020;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font: 700 13px Arial, sans-serif;
  box-shadow: 0 6px 14px rgba(32,32,32,.24);
  max-width: calc(100vw - 32px);
}
.fm-toast.is-err { background: #A71F23; }
