/* Team logistics page. Same tokens as HQ (light slate), phone-first: one column at 390px, wider grid on desktop. */
:root {
  --page: #f4f4f2; --surface: #ffffff; --surface-2: #ececea; --track: #e4e4e1;
  --ink: #111110; --ink-2: #4a4945; --muted: #6f6e68;
  --border: rgba(0,0,0,0.08); --border-3: rgba(0,0,0,0.18);
  --accent: #2a78d6; --accent-2: #1c5cab; --accent-soft: rgba(42,120,214,0.14);
  --good: #0a7d0a; --good-soft: rgba(12,163,12,0.16);
  --warn: #9a5b00; --warn-soft: rgba(250,178,25,0.18);
  --crit: #d03b3b; --crit-text: #b91c1c; --crit-soft: rgba(208,59,59,0.14);
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body { background: var(--page); color: var(--ink); font-family: "Space Grotesk", "Segoe UI", system-ui, sans-serif; font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: "JetBrains Mono", Consolas, monospace; font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border-3); font-weight: 600; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { border-color: transparent; color: var(--ink-2); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }

/* login + password screens */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .box { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 26px 22px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.login h1 { font-size: 22px; margin: 14px 0 4px; }
.login p { color: var(--muted); margin-bottom: 18px; font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.field input, .field select, .field textarea { background: var(--surface); border: 1px solid var(--border-3); border-radius: 10px; padding: 11px 12px; width: 100%; font-size: 16px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.err { color: var(--crit-text); font-size: 13px; min-height: 18px; margin-bottom: 8px; }
.lang-row { display: flex; justify-content: center; gap: 6px; margin-top: 16px; }
.lang { padding: 6px 10px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 13px; }
.lang.active { background: var(--surface-2); color: var(--ink); }

/* header */
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); flex: 0 0 28px; }
.brand b { font-weight: 700; font-size: 16px; display: block; line-height: 1.1; }
.brand small { color: var(--muted); font-size: 12px; }
.top { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.top-actions { display: flex; align-items: center; gap: 4px; }
.top-actions .btn { min-height: 36px; padding: 6px 10px; white-space: nowrap; }
.brand small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; display: block; }
.top .brand b { font-size: 15px; }

/* stage tabs */
.stages { display: flex; gap: 6px; padding: 10px 14px 0; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.stages::after { content: ''; flex: 0 0 20px; }   /* room to scroll the last tab clear of the fade */
.stages::-webkit-scrollbar { display: none; }
.stage-tab { flex: 0 0 auto; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border-3); background: var(--surface); font-weight: 600; font-size: 13px; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.stage-tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.stage-tab .n { font-family: "JetBrains Mono", monospace; font-size: 12px; opacity: .8; }

/* order cards */
.orders { padding: 12px 14px 90px; display: grid; gap: 10px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 8px; }
.card.late { border-left: 4px solid var(--crit); }
.card .title { font-weight: 600; font-size: 16px; line-height: 1.3; }
.card .row { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13px; color: var(--muted); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.urgent { background: var(--crit-soft); color: var(--crit-text); }
.pill.new { background: var(--accent-soft); color: var(--accent-2); }
.pill.working { background: var(--good-soft); color: var(--good); }
.pill.pending { background: var(--warn-soft); color: var(--warn); }
.pill.hold { background: var(--surface-2); color: var(--ink-2); }
.pill.co { background: var(--surface-2); color: var(--ink-2); }
.late-txt { color: var(--crit-text); font-weight: 600; }
.card .last { font-size: 13px; color: var(--ink-2); border-top: 1px dashed var(--border); padding-top: 8px; }
.card .last b { color: var(--muted); font-weight: 500; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }

/* bottom sheet (order detail / new order) */
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet-body { background: var(--surface); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 14px 16px 24px; }
.sheet-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.sheet-h h2 { font-size: 18px; line-height: 1.3; }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.meta b { color: var(--ink-2); font-weight: 500; }
.stage-picker { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.stage-picker .btn { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.stage-picker .btn.current { background: var(--ink); color: #fff; border-color: var(--ink); }
.stage-picker .btn.done { border-color: var(--good); color: var(--good); }
.thread { display: grid; gap: 8px; margin: 6px 0 12px; }
.msg { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.msg.system { background: transparent; color: var(--muted); font-size: 13px; padding: 2px 4px; }
.msg .who { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.compose { display: flex; gap: 8px; align-items: flex-end; }
.compose textarea { flex: 1; min-height: 44px; resize: vertical; }
.section-h { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; margin: 8px 0 6px; }

/* partners (2026-10-07) */
.views { display: flex; gap: 4px; padding: 10px 14px 0; }
.view-tab { flex: 1 1 0; padding: 9px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--ink-2); background: var(--surface-2); }
.view-tab.active { background: var(--accent); color: #fff; }
.partners { padding: 12px 14px 90px; display: grid; gap: 10px; }
.partners .cards { display: grid; gap: 10px; align-items: start; }
.partners .bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.partners .bar .section-h { margin: 0; }
.subtabs { display: flex; flex-wrap: wrap; gap: 6px; }   /* wraps on a phone: all four always visible */
.card .sub { font-size: 13px; color: var(--muted); }
.card select.status { min-height: 36px; border: 1px solid var(--border-3); border-radius: 8px; padding: 4px 8px; background: var(--surface); font-size: 14px; max-width: 100%; }
.pill.rs-sent { background: var(--surface-2); color: var(--ink-2); }
.pill.rs-contacted { background: var(--warn-soft); color: var(--warn); }
.pill.rs-signed_up { background: var(--accent-soft); color: var(--accent-2); }
.pill.rs-active { background: var(--good-soft); color: var(--good); }
.pill.rs-not_interested { background: var(--crit-soft); color: var(--crit-text); }
.kv { display: grid; gap: 2px; font-size: 14px; }
.kv b { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.kv div { white-space: pre-wrap; overflow-wrap: anywhere; }
.line { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; }
.line .mono { white-space: nowrap; }
.line a { color: var(--accent-2); font-weight: 600; overflow-wrap: anywhere; }
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.form-card .row2 { display: grid; grid-template-columns: 1fr; gap: 0 8px; }

/* FIG tab (design/team-fig-tab-SPEC.md): four list tabs, Mine/Everyone, search, one card column on a phone */
.fig { padding: 12px 14px 90px; display: grid; gap: 10px; }
.fig-bar { display: flex; gap: 8px; align-items: center; }
.seg { display: inline-flex; flex: 0 0 auto; border: 1px solid var(--border-3); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg button { padding: 8px 12px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.seg button.on { background: var(--ink); color: #fff; }
.fig-bar input { flex: 1 1 auto; min-width: 0; min-height: 38px; border: 1px solid var(--border-3); border-radius: 10px; padding: 6px 10px; background: var(--surface); font: inherit; font-size: 14px; }
.fig-bar input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.fig-body { display: grid; gap: 10px; }
.fig-body .cards { display: grid; gap: 10px; align-items: start; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; transition: .2s; z-index: 30; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%); }

@media (min-width: 720px) {
  .orders { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); padding: 16px 20px 40px; max-width: 1200px; margin: 0 auto; }
  .stages { padding: 12px 20px 0; max-width: 1200px; margin: 0 auto; }
  .views { padding: 12px 20px 0; max-width: 1200px; margin: 0 auto; }
  .view-tab { flex: 0 0 auto; padding: 9px 18px; }
  .form-card .row2 { grid-template-columns: 1fr 1fr; }
  .partners { padding: 16px 20px 40px; max-width: 1200px; margin: 0 auto; }
  .partners .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
  .fig { padding: 16px 20px 40px; max-width: 1200px; margin: 0 auto; }
  .fig-bar input { max-width: 360px; }
  .fig-body .cards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .sheet { align-items: center; }
  .sheet-body { border-radius: 18px; }
}
