/* SiteTrack — construction ops mock
   Design tokens + crew (phone) + office (laptop) UI */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter-400.ttf") format("truetype");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/inter-500.ttf") format("truetype");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/inter-600.ttf") format("truetype");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/inter-700.ttf") format("truetype");
}

:root {
  --navy: #0F2A4A;
  --navy-2: #173A5F;
  --navy-3: #1E4A75;
  --orange: #F97316;
  --orange-d: #EA580C;
  --orange-s: #FFF1E7;
  --bg: #F3F1EE;
  --card: #FFFFFF;
  --line: #E5E1DB;
  --line-2: #D4D0C9;
  --text: #0F2A4A;
  --text-2: #3A4658;
  --text-3: #5C6776;
  --text-4: #7A8492;
  --ok: #157A3A;
  --ok-bg: #E7F6EC;
  --ok-bd: #BFE5CB;
  --warn: #A15C07;
  --warn-bg: #FDF3E3;
  --warn-bd: #F5D9A8;
  --bad: #B42318;
  --bad-bg: #FDECEC;
  --bad-bd: #F3C4C0;
  --info: #1559C0;
  --shadow-sm: 0 1px 2px rgba(15, 42, 74, 0.05);
  --shadow: 0 1px 2px rgba(15, 42, 74, 0.05), 0 8px 20px rgba(15, 42, 74, 0.05);
  --r: 14px;
  --r-sm: 10px;
  --safe-top: 54px;
  --header-h: 52px;
  --tab-h: 64px;
  --home-ind: 18px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  min-height: 100%;
}
img { display: block; max-width: 100%; }
button, input, textarea { font-family: inherit; }
button { cursor: pointer; border: 0; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
.num { font-variant-numeric: tabular-nums lining-nums; }

/* ---------- Icons ---------- */
.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-18 { width: 18px; height: 18px; }
.icon-16 { width: 16px; height: 16px; }
.icon-22 { width: 22px; height: 22px; }
.icon-24 { width: 24px; height: 24px; }
.icon-fill { fill: currentColor; stroke: none; }

/* ---------- Shared bits ---------- */
.logo-mark {
  width: 32px; height: 32px; border-radius: 8px; background: var(--navy);
  display: grid; place-items: center; flex: none;
}
.logo-mark svg { width: 18px; height: 18px; }
.logo-word { font-weight: 700; letter-spacing: -0.04em; font-size: 16px; color: var(--navy); }
.avatar {
  border-radius: 50%; display: grid; place-items: center;
  font-weight: 600; letter-spacing: -0.02em; color: #fff; flex: none;
  overflow: hidden; text-transform: uppercase;
}
.av-28 { width: 28px; height: 28px; font-size: 11px; }
.av-32 { width: 32px; height: 32px; font-size: 12px; }
.av-36 { width: 36px; height: 36px; font-size: 13px; }
.av-40 { width: 40px; height: 40px; font-size: 14px; }
.av-navy { background: #1E4A75; }
.av-teal { background: #0F6B6B; }
.av-olive { background: #5B6B2F; }
.av-plum { background: #6B3A58; }
.av-rust { background: #9A4A1C; }
.av-slate { background: #4A5A6B; }
.av-blue { background: #2A5F9E; }
.av-forest { background: #2F6B4A; }
.av-wine { background: #7A3340; }
.av-sand { background: #8A6A3A; }
.av-orange { background: #C05621; }
.av-ink { background: #0F2A4A; }
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap;
  border: 1px solid transparent;
}
.pill-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-bd); }
.pill-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-bd); }
.pill-bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-bd); }
.pill-neutral { background: #EEF0F3; color: var(--text-2); border-color: var(--line); }
.pill-orange { background: var(--orange-s); color: var(--orange-d); border-color: #F8D2B5; }

.progress {
  height: 6px; background: #E8E5E0; border-radius: 99px; overflow: hidden;
}
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--navy); }
.progress.ok > span { background: var(--ok); }
.progress.warn > span { background: #D97706; }
.progress.bad > span { background: var(--bad); }
.progress.orange > span { background: var(--orange); }

/* =========================================================
   CREW (phone)
   ========================================================= */
body.crew {
  background: var(--bg);
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}
.crew-app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* iOS status bar */
.status-bar {
  height: var(--safe-top);
  padding: 12px 28px 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: flex-start;
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
}
.status-bar .time {
  font-size: 15px; font-weight: 600; letter-spacing: -0.02em;
  padding-top: 2px; font-variant-numeric: tabular-nums;
}
.status-bar .island {
  width: 118px; height: 32px; background: #0A0A0A; border-radius: 20px;
  margin-top: -2px;
}
.status-bar .right {
  display: flex; justify-content: flex-end; align-items: center; gap: 6px;
  padding-top: 4px; color: var(--text);
}
.status-bar .right svg { display: block; }

.crew-header {
  height: var(--header-h);
  padding: 0 16px;
  display: flex; align-items: center; gap: 10px;
  position: sticky; top: var(--safe-top); z-index: 40;
  background: var(--bg);
}
.crew-header .titles { flex: 1; min-width: 0; }
.crew-header .proj {
  font-size: 13px; font-weight: 600; letter-spacing: -0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.crew-header .sub {
  font-size: 11px; color: var(--text-3); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; color: var(--navy);
  position: relative; flex: none;
}
.icon-btn:active { background: #E8E5E0; }
.icon-btn .badge-dot {
  position: absolute; top: 10px; right: 10px;
  width: 8px; height: 8px; background: var(--orange); border-radius: 50%;
  border: 2px solid var(--bg);
}

.crew-body {
  flex: 1;
  padding: 4px 16px 12px;
  padding-bottom: calc(var(--tab-h) + var(--home-ind) + 10px);
}

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--tab-h) + var(--home-ind));
  padding: 6px 8px 0;
  background: rgba(255,255,255,0.94);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--line);
  display: flex;
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: flex-start; gap: 3px; padding-top: 4px;
  min-height: 48px; color: var(--text-4); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.01em;
}
.tabbar a.active { color: var(--navy); font-weight: 600; }
.tabbar a.active .icon { stroke-width: 2.1; }
.tabbar .home-ind {
  position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%);
  width: 128px; height: 5px; background: #0A0A0A; border-radius: 99px;
}

.hello {
  padding: 2px 2px 14px;
}
.hello h1 {
  margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.2;
}
.hello p {
  margin: 4px 0 0; font-size: 14px; color: var(--text-3); font-weight: 500;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 10px; }

/* Time card */
.time-card {
  padding: 18px 16px 16px;
  background: var(--navy);
  border: none;
  color: #fff;
  box-shadow: 0 10px 28px rgba(15, 42, 74, 0.22);
}
.time-card .kicker {
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: rgba(255,255,255,0.62);
}
.time-card .status-line {
  margin-top: 6px; font-size: 20px; font-weight: 700; letter-spacing: -0.03em;
}
.time-card .meta {
  margin-top: 4px; font-size: 13px; color: rgba(255,255,255,0.7);
}
.btn-timein {
  margin-top: 16px; width: 100%; height: 56px;
  background: var(--orange); color: #fff;
  font-size: 17px; font-weight: 700; letter-spacing: -0.02em;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 6px 16px rgba(249, 115, 22, 0.35);
}
.btn-timein:active { background: var(--orange-d); transform: translateY(1px); }
.btn-timein .icon { width: 22px; height: 22px; }
.time-card.timed-in { background: #123B2A; box-shadow: 0 10px 28px rgba(18, 59, 42, 0.22); }
.time-card.timed-in .btn-timeout {
  margin-top: 16px; width: 100%; height: 52px;
  background: transparent; color: #fff;
  font-size: 16px; font-weight: 600;
  border-radius: 14px; border: 1.5px solid rgba(255,255,255,0.28);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.hidden { display: none !important; }

.section-h {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 18px 2px 8px;
}
.section-h h2 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -0.02em; }
.section-h .count, .section-h .link {
  font-size: 13px; font-weight: 550; color: var(--text-3);
}
.section-h a.link { color: var(--info); font-weight: 600; }

/* Tasks */
.task {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 14px;
  min-height: 64px;
}
.task + .task { border-top: 1px solid var(--line); }
.chk {
  width: 24px; height: 24px; border-radius: 8px;
  border: 1.75px solid #C5C0B8; flex: none; margin-top: 1px;
  background: #fff;
}
.task.done .chk {
  background: var(--ok); border-color: var(--ok);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 12.5 10 16l7.5-8'/%3E%3C/svg%3E");
  background-size: 22px; background-position: center;
}
.task .body { flex: 1; min-width: 0; }
.task .title { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }
.task.done .title { color: var(--text-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.task .meta { margin-top: 3px; font-size: 13px; color: var(--text-3); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.prio { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; color: var(--bad); }

/* On site row */
.onsite {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
}
.onsite .stack { display: flex; }
.onsite .stack .avatar { box-shadow: 0 0 0 2px #fff; margin-left: -6px; }
.onsite .stack .avatar:first-child { margin-left: 0; }
.onsite .copy { flex: 1; }
.onsite .copy strong { display: block; font-size: 14px; font-weight: 650; letter-spacing: -0.02em; }
.onsite .copy span { font-size: 12px; color: var(--text-3); }

/* Updates */
.composer {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  min-height: 56px;
}
.composer .prompt {
  flex: 1; height: 40px; border-radius: 10px; background: var(--bg);
  border: 1px solid var(--line);
  display: flex; align-items: center; padding: 0 12px;
  font-size: 14px; color: var(--text-4);
}
.composer .act {
  width: 44px; height: 44px; border-radius: 12px; color: var(--navy);
  display: grid; place-items: center;
}

.post { padding: 14px 14px 12px; margin-top: 10px; }
.post-h { display: flex; align-items: center; gap: 10px; }
.post-h .who { flex: 1; min-width: 0; }
.post-h .name { font-size: 15px; font-weight: 650; letter-spacing: -0.02em; }
.post-h .when { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.post .text { margin: 10px 0 12px; font-size: 15px; line-height: 1.45; color: var(--text); }
.post-photo {
  position: relative; border-radius: 12px; overflow: hidden;
  background: #D9D4CC; aspect-ratio: 16/11;
}
.post-photo img { width: 100%; height: 100%; object-fit: cover; }
.video-chip {
  position: absolute; left: 10px; bottom: 10px;
  height: 28px; padding: 0 10px 0 8px;
  background: rgba(10,10,10,0.78); color: #fff;
  border-radius: 8px; display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; letter-spacing: -0.01em;
}
.video-chip .play {
  width: 16px; height: 16px; border-radius: 50%; background: #fff; color: #0A0A0A;
  display: grid; place-items: center;
}
.video-chip .play svg { width: 10px; height: 10px; }
.post-foot {
  margin-top: 10px; display: flex; align-items: center; gap: 14px;
  font-size: 12px; color: var(--text-3); font-weight: 500;
}
.post-foot .item { display: flex; align-items: center; gap: 5px; }
.comments { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.comment { display: flex; gap: 8px; align-items: flex-start; }
.comment .bubble { flex: 1; }
.comment .nm { font-size: 13px; font-weight: 650; }
.comment .nm span { font-weight: 500; color: var(--text-3); margin-left: 6px; font-size: 11px; }
.comment .tx { font-size: 13.5px; line-height: 1.4; color: var(--text-2); margin-top: 1px; }

/* Inventory */
.search {
  display: flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 14px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--text-4); font-size: 15px;
}
.search .placeholder { flex: 1; }
.alert-banner {
  margin-top: 10px; padding: 12px 14px;
  background: var(--warn-bg); border: 1px solid var(--warn-bd);
  border-radius: 12px; display: flex; gap: 10px; align-items: flex-start;
  color: var(--warn);
}
.alert-banner .copy { font-size: 13.5px; line-height: 1.4; color: #7A4508; }
.alert-banner .copy strong { font-weight: 650; color: #6B3B05; }
.inv-list { margin-top: 10px; overflow: hidden; }
.inv-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; min-height: 68px;
}
.inv-row + .inv-row { border-top: 1px solid var(--line); }
.inv-ico {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center; flex: none;
  background: #F3F1EE; color: var(--navy);
}
.inv-row .body { flex: 1; min-width: 0; }
.inv-row .name { font-size: 15px; font-weight: 650; letter-spacing: -0.02em; }
.inv-row .meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.inv-row .qty { text-align: right; flex: none; }
.inv-row .qty .n { font-size: 16px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.inv-row .qty .u { font-size: 11px; color: var(--text-3); font-weight: 500; }
.inv-row.low .qty .n { color: var(--bad); }

/* Chat */
.chat-app .crew-body { padding: 0 0 calc(var(--tab-h) + var(--home-ind) + 66px); }
.chat-thread { padding: 8px 16px 12px; display: flex; flex-direction: column; gap: 8px; }
.day-sep {
  align-self: center; font-size: 11px; font-weight: 600; color: var(--text-3);
  background: #E8E5E0; padding: 4px 10px; border-radius: 99px; margin: 6px 0;
  letter-spacing: 0.02em;
}
.bubble-row { display: flex; gap: 8px; align-items: flex-end; max-width: 86%; }
.bubble-row.me { align-self: flex-end; flex-direction: row-reverse; }
.msg {
  padding: 9px 12px; border-radius: 16px;
  font-size: 15px; line-height: 1.4; letter-spacing: -0.01em;
}
.bubble-row.them .msg { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; color: var(--text); }
.bubble-row.me .msg { background: var(--navy); color: #fff; border-bottom-right-radius: 5px; }
.msg .who { font-size: 11px; font-weight: 700; margin-bottom: 2px; color: #1E4A75; }
.bubble-row.me .msg .who { color: rgba(255,255,255,0.7); }
.msg .tm { display: block; font-size: 10.5px; font-weight: 500; margin-top: 4px; color: var(--text-4); font-variant-numeric: tabular-nums; }
.bubble-row.me .msg .tm { color: rgba(255,255,255,0.55); text-align: right; }
.chat-input {
  position: fixed; left: 0; right: 0; z-index: 45;
  bottom: calc(var(--tab-h) + var(--home-ind));
  padding: 8px 12px;
  background: var(--bg);
  display: flex; align-items: center; gap: 8px;
}
.chat-input .add {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  color: var(--navy); flex: none;
}
.chat-input .field {
  flex: 1; height: 44px; background: #fff; border: 1px solid var(--line);
  border-radius: 22px; padding: 0 16px; display: flex; align-items: center;
  font-size: 15px; color: var(--text-4);
}
.chat-input .send {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: var(--orange); color: #fff; display: grid; place-items: center;
  box-shadow: 0 4px 10px rgba(249,115,22,0.3);
}

/* =========================================================
   OFFICE (laptop)
   ========================================================= */
body.office {
  background: #EDEBE7;
  height: 100vh; overflow: hidden;
}
.desk {
  display: grid;
  grid-template-columns: 228px 1fr;
  height: 100vh;
  background: var(--bg);
}
.sidebar {
  background: var(--navy);
  color: #fff;
  display: flex; flex-direction: column;
  padding: 18px 14px 16px;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 2px 8px 18px;
}
.sidebar .brand .logo-mark { background: #fff; }
.sidebar .brand .logo-mark svg path,
.sidebar .brand .logo-mark svg rect { /* invert handled in svg */ }
.sidebar .brand .logo-word { color: #fff; font-size: 16px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 10px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500; color: rgba(255,255,255,0.72);
}
.side-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.side-nav a.active {
  background: rgba(255,255,255,0.12); color: #fff; font-weight: 600;
}
.side-nav a.active { box-shadow: inset 3px 0 0 0 var(--orange); padding-left: 7px; }
.side-nav .sec {
  margin: 16px 10px 6px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.4);
}
.sidebar .foot {
  margin-top: auto; padding: 12px 8px 0; border-top: 1px solid rgba(255,255,255,0.1);
}
.proj-switch {
  display: flex; align-items: center; gap: 8px;
  padding: 8px; border-radius: 10px;
  background: rgba(255,255,255,0.06);
}
.proj-switch .txt { flex: 1; min-width: 0; }
.proj-switch .txt strong { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: -0.02em; }
.proj-switch .txt span { display: block; font-size: 11px; color: rgba(255,255,255,0.55); margin-top: 1px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  height: 56px; flex: none;
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.topbar h1 {
  margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -0.03em; flex: none;
}
.topbar .crumb { color: var(--text-3); font-weight: 500; font-size: 16px; }
.search-desk {
  margin-left: auto;
  width: 260px; height: 36px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 9px;
  display: flex; align-items: center; gap: 8px; padding: 0 10px;
  color: var(--text-4); font-size: 13px;
}
.topbar .who { display: flex; align-items: center; gap: 10px; }
.topbar .who .nm { font-size: 13px; font-weight: 600; letter-spacing: -0.02em; }
.topbar .who .role { font-size: 11px; color: var(--text-3); }

.workspace {
  flex: 1; min-height: 0; overflow: hidden;
  padding: 18px 24px 18px;
  display: flex; flex-direction: column; gap: 14px;
}

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px 13px; box-shadow: var(--shadow-sm);
  min-height: 86px;
}
.kpi .lbl { font-size: 12px; font-weight: 600; color: var(--text-3); letter-spacing: 0.01em; }
.kpi .val {
  margin-top: 4px; font-size: 22px; font-weight: 700;
  letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1.15;
}
.kpi .hint { margin-top: 5px; font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.kpi .hint.up { color: var(--ok); font-weight: 550; }
.kpi .hint.down { color: var(--bad); font-weight: 550; }
.kpi .hint.neutral { color: var(--text-3); }

.row { display: grid; gap: 12px; min-height: 0; }
.row-2a { grid-template-columns: 1.25fr 0.9fr; flex: 0 0 auto; }
.row-2b { grid-template-columns: 1.45fr 0.85fr; flex: 1; min-height: 0; }

.panel {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 14px 16px 14px;
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
}
.panel-h {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px; gap: 8px;
}
.panel-h h2 { margin: 0; font-size: 13.5px; font-weight: 650; letter-spacing: -0.02em; }
.panel-h .sub { font-size: 12px; color: var(--text-3); font-weight: 500; }

.ms-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 8px 0; }
.ms-item + .ms-item { border-top: 1px solid var(--line); }
.ms-item .t { font-size: 13.5px; font-weight: 600; letter-spacing: -0.02em; }
.ms-item .d { font-size: 12px; color: var(--text-3); grid-column: 1; }
.ms-item .progress { grid-column: 1 / -1; margin-top: 4px; }
.ms-item .pill { justify-self: end; }

.month-list { display: flex; flex-direction: column; gap: 10px; }
.month-row .lab { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.month-row .lab b { font-weight: 600; letter-spacing: -0.02em; }
.month-row .lab span { font-variant-numeric: tabular-nums; color: var(--text-2); font-weight: 600; font-size: 12.5px; }

table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th {
  text-align: left; font-size: 11px; font-weight: 600; color: var(--text-3);
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 0 10px 8px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data th.r, table.data td.r { text-align: right; }
table.data td {
  padding: 8px 10px; border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
  vertical-align: middle;
}
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: #FAF9F7; }
table.data .cat { font-weight: 600; letter-spacing: -0.02em; }
table.data tfoot td {
  border-top: 1.5px solid var(--line-2); border-bottom: 0;
  font-weight: 700; padding-top: 9px; background: #FAF9F7;
}
.delta-pos { color: var(--ok); font-weight: 600; }
.delta-neg { color: var(--bad); font-weight: 600; }

.side-stack { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.side-stack .panel { flex: 0 0 auto; }

.crew-list { display: flex; flex-direction: column; gap: 2px; }
.crew-li { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; }
.crew-li .nm { flex: 1; font-weight: 550; letter-spacing: -0.02em; }
.crew-li .st { font-size: 11px; font-weight: 650; }
.crew-li .st.in { color: var(--ok); }
.crew-li .st.out { color: var(--text-4); }
.crew-li .tm { font-variant-numeric: tabular-nums; color: var(--text-3); font-size: 12px; width: 44px; text-align: right; }

.low-li { display: flex; align-items: center; gap: 8px; padding: 7px 0; }
.low-li + .low-li { border-top: 1px solid var(--line); }
.low-li .body { flex: 1; min-width: 0; }
.low-li .name { font-size: 13px; font-weight: 600; letter-spacing: -0.02em; }
.low-li .meta { font-size: 11.5px; color: var(--text-3); }
.low-li .n { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--bad); font-size: 13px; }

/* Materials / payroll pages */
.toolbar { display: flex; align-items: center; gap: 10px; flex: none; }
.seg {
  display: flex; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 3px;
}
.seg a, .seg span {
  height: 28px; padding: 0 10px; border-radius: 7px;
  font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center;
  color: var(--text-3);
}
.seg .on { background: var(--navy); color: #fff; }
.btn-primary {
  height: 34px; padding: 0 14px; border-radius: 9px;
  background: var(--orange); color: #fff; font-size: 13px; font-weight: 650;
  display: inline-flex; align-items: center; gap: 6px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset;
}
.btn-ghost {
  height: 34px; padding: 0 12px; border-radius: 9px;
  background: #fff; border: 1px solid var(--line); color: var(--navy);
  font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}

.workspace.page { overflow: hidden; }
.table-wrap {
  flex: 1; min-height: 0; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
}
.table-wrap table.data { font-size: 13px; }
.table-wrap table.data th { padding: 10px 14px 9px; }
.table-wrap table.data td { padding: 9px 14px; }
.table-wrap .scroll { flex: 1; overflow: hidden; }

/* Landing */
body.land { background: #EDEBE7; min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; }
.land-card {
  width: 100%; max-width: 720px; background: #fff; border: 1px solid var(--line);
  border-radius: 20px; padding: 36px 36px 28px; box-shadow: var(--shadow);
}
.land-card h1 { margin: 16px 0 6px; font-size: 28px; letter-spacing: -0.04em; font-weight: 700; }
.land-card .lede { margin: 0 0 28px; color: var(--text-3); font-size: 15px; line-height: 1.5; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.choice {
  display: block; border: 1px solid var(--line); border-radius: 16px; padding: 20px;
  background: var(--bg); min-height: 160px; transition: border-color .15s, transform .15s;
}
.choice:hover { border-color: var(--navy); transform: translateY(-1px); }
.choice h2 { margin: 12px 0 6px; font-size: 18px; letter-spacing: -0.03em; }
.choice p { margin: 0; font-size: 13.5px; color: var(--text-3); line-height: 1.45; }
.land-note { margin: 22px 0 0; font-size: 12px; color: var(--text-4); text-align: center; }
@media (max-width: 640px) {
  .land-card { padding: 28px 20px; }
  .choices { grid-template-columns: 1fr; }
}

/* Tighter updates so the full post + comments fit a 844 screen */
.post { padding: 12px 14px 10px; margin-top: 8px; }
.post .text { margin: 8px 0 10px; font-size: 15px; line-height: 1.4; }
.post-photo { aspect-ratio: 16 / 9.2; }
.post-foot { margin-top: 8px; }
.comments { margin-top: 8px; padding-top: 8px; gap: 8px; }
.hello.tight { padding: 0 2px 8px; }
.hello.tight h1 { font-size: 22px; }

/* Chat: top-align avatars, tighter bubbles, enough room above composer */
.bubble-row { align-items: flex-start; }
.chat-thread { padding: 4px 16px 8px; gap: 7px; }
.msg { padding: 8px 11px; font-size: 14.5px; line-height: 1.38; }
.day-sep { margin: 2px 0 6px; }
.chat-app .crew-body { padding: 0 0 calc(var(--tab-h) + var(--home-ind) + 62px) !important; }

/* Task priority inline */
.task .title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.task .prio-pill {
  flex: none; margin-top: 1px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  color: var(--bad); background: var(--bad-bg); border: 1px solid var(--bad-bd);
  border-radius: 6px; padding: 2px 6px; height: 18px; display: inline-flex; align-items: center;
}

/* Desktop: frame the crew app like a phone so the clickable mock doesn't stretch */
@media (min-width: 520px) {
  body.crew {
    background: #D8D4CE;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
  }
  .crew-app {
    width: 390px;
    height: 844px;
    min-height: 844px;
    max-height: 844px;
    border-radius: 44px;
    overflow: hidden;
    background: var(--bg);
    box-shadow: 0 0 0 10px #1A1A1A, 0 0 0 12px #2A2A2A, 0 30px 60px rgba(15,42,74,0.28);
    position: relative;
  }
  .tabbar { width: 390px; left: 50%; right: auto; transform: translateX(-50%); border-bottom-left-radius: 44px; border-bottom-right-radius: 44px; }
  .chat-input { width: 390px; left: 50%; right: auto; transform: translateX(-50%); }
}

/* Materials unit column: no leading slash */
td.unit { color: var(--text-3); }

.crew-note {
  margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--text-3); font-weight: 500; line-height: 1.4;
}

.crew-li { padding: 4px 0; }
.crew-li.more .nm { font-weight: 500; color: var(--text-2); font-size: 12.5px; }
