/* ============ OnboardPilot AI — "The Welcome Desk" ============
   Warm HR software: deep forest-green sidebar, cream paper workspace,
   gold secondary accent. Grounded in BambooHR (phase-grouped checklists,
   per-task due dates, warm people-first design) and Rippling (30-60-90
   milestone thinking). Zero rounded edges. */

:root {
  --paper: #faf7ef;
  --paper-2: #f2eddd;
  --card: #fffdf8;
  --ink: #26302a;
  --ink-soft: #46554c;
  --muted: #7d887f;
  --faint: #a9b2a9;
  --line: #e4dcc8;
  --forest: #1e4633;
  --forest-2: #142e22;
  --forest-deep: #0f2419;
  --green: #2e7d4f;
  --green-soft: #e9f4ec;
  --gold: #b8862e;
  --gold-soft: #faf1dc;
  --red: #b3382e;
  --red-soft: #fbeae8;
  --shadow: 0 1px 2px rgba(20, 46, 34, .07), 0 12px 28px -16px rgba(20, 46, 34, .2);
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--sans); font-size: 15px; line-height: 1.55;
  color: var(--ink); background: var(--paper);
}
button { font-family: inherit; }
::selection { background: var(--forest); color: #fff; }

/* ============ shell ============ */
.shell { display: flex; min-height: 100vh; align-items: stretch; }
.topbar {
  flex: none; width: 288px; background: var(--forest-2); color: #eef3ee;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background-image: radial-gradient(520px 300px at 50% -80px, rgba(184,134,46,.14), transparent 70%);
}
.topbar-inner { display: flex; flex-direction: column; gap: 14px; padding: 26px 24px 22px; min-height: 100%; }
.brandrow { display: flex; align-items: center; gap: 12px; }
.brandmark {
  width: 42px; height: 42px; display: grid; place-items: center; flex: none;
  background: var(--gold); color: var(--forest-deep);
  box-shadow: 0 4px 14px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.35);
}
.brand { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -.4px; white-space: nowrap; }
.brand span { font-weight: 600; color: #d9b96a; font-size: 15px; }
.tagline { margin: 0; color: #9fb3a4; font-size: 13px; line-height: 1.6; }
.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.nav button {
  border: none; background: transparent; cursor: pointer; text-align: left;
  font-weight: 700; font-size: 14px; color: #9fb3a4;
  padding: 11px 14px; border-left: 3px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.nav button:hover { color: #f2f6f2; background: rgba(255,255,255,.05); }
.nav button.active { background: rgba(184,134,46,.18); color: #fff; border-left-color: var(--gold); }
.local-pill {
  margin-top: auto; display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: #c3d2c7;
  border: 1px solid rgba(255,255,255,.22); padding: 7px 13px; width: fit-content;
}
.local-pill i { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,.2); }

/* ============ workspace ============ */
.mainwrap { flex: 1; min-width: 0; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 30px 32px 0; }
.view { display: none; }
.view.active { display: block; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-top: 4px solid var(--forest); box-shadow: var(--shadow);
  padding: 22px 24px; margin-bottom: 18px;
}
.card h2 { margin: 0 0 14px; font-size: 19px; letter-spacing: -.3px; }
.card h3 { margin: 18px 0 10px; font-size: 16px; }
.small { font-size: 13px; }
.muted { color: var(--muted); }

/* ============ forms & buttons ============ */
.form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
input, select, textarea {
  font: inherit; font-size: 14px; color: var(--ink);
  border: 1.5px solid var(--line); padding: 10px 13px; background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(30, 70, 51, .13);
}
.btn {
  background: var(--forest); border: 1.5px solid var(--forest); color: #fff;
  padding: 10px 18px; font-weight: 700; font-size: 14px; cursor: pointer;
  box-shadow: 0 4px 14px -4px rgba(30, 70, 51, .5);
  transition: transform .15s, background .15s;
}
.btn:hover { background: var(--forest-2); transform: translateY(-1px); }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink); box-shadow: none; }
.btn.ghost:hover { border-color: var(--forest); }
.btn.danger { background: transparent; border-color: #eec5c1; color: var(--red); box-shadow: none; }
.btn.danger:hover { background: var(--red-soft); }
.btn.small { padding: 6px 12px; font-size: 12.5px; }

/* ============ badges & chips ============ */
.badge {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .8px;
  text-transform: uppercase; padding: 3px 10px; background: var(--paper-2); color: var(--ink-soft);
}
.badge.overdue { background: var(--red-soft); color: var(--red); border: 1px solid #eec5c1; }
.badge.done { background: var(--green-soft); color: var(--green); border: 1px solid #bfe3cb; }
.due-chip {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  background: var(--paper-2); color: var(--ink-soft); padding: 3px 10px;
  border: 1px solid var(--line); white-space: nowrap;
}
.due-chip.od { background: var(--red-soft); color: var(--red); border-color: #eec5c1; font-weight: 800; }
.milestone { font-weight: 600; color: var(--ink-soft); margin: 6px 0; }
.milestone.over { color: var(--red); font-weight: 700; }

/* ============ hire cards ============ */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.hire-card { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.hire-card:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -16px rgba(20,46,34,.3); }
.hc-top { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.hc-id { flex: 1; min-width: 0; }
.bp-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 21px; font-weight: 800;
  background: var(--forest); color: #f2e8c9;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.15);
}
.bp-name { font-size: 17px; font-weight: 800; letter-spacing: -.2px; }
.ring { flex: none; }
.ring-track { fill: none; stroke: #e8e2cf; stroke-width: 6; }
.ring-fill { fill: none; stroke: var(--green); stroke-width: 6; }
.ring-num { font-family: var(--mono); font-size: 15px; font-weight: 800; fill: var(--ink); }
.minis { display: flex; gap: 6px; margin: 10px 0 4px; }
.mini { flex: 1; height: 7px; background: #e8e2cf; position: relative; }
.mini i { position: absolute; top: 0; bottom: 0; left: 0; background: var(--green); }
.bp-status { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }

/* ============ journey timeline ============ */
.journey {
  display: flex; align-items: flex-start; margin: 22px 0 8px; padding: 0 6px;
}
.station { flex: 1; text-align: center; position: relative; padding-top: 26px; }
.station::before {
  content: ""; position: absolute; top: 12px; left: -50%; width: 100%; height: 3px;
  background: #ddd5ba;
}
.station:first-child::before { display: none; }
.station.done::before { background: var(--green); }
.pin {
  position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  width: 19px; height: 19px; border-radius: 50%;
  background: #fff; border: 3px solid #c9c0a4;
}
.station.done .pin { background: var(--green); border-color: var(--green); }
.station.now .pin { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 5px rgba(184,134,46,.2); }
.s-label { font-size: 13px; font-weight: 800; }
.s-count { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ============ hire detail ============ */
.detail-head { display: flex; align-items: center; gap: 16px; margin-bottom: 6px; flex-wrap: wrap; }
.detail-avatar {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  font-size: 26px; font-weight: 800; background: var(--forest); color: #f2e8c9; flex: none;
}
.detail-head h2 { margin: 0; font-size: 24px; letter-spacing: -.5px; }
.detail-progress { margin-left: auto; min-width: 220px; }
.bar { height: 8px; background: #e8e2cf; margin-top: 6px; }
.bar > div { height: 100%; background: var(--green); }
.phase-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 20px 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--forest);
}
.phase-head strong { font-size: 15px; letter-spacing: .4px; }
.task {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff; border: 1px solid var(--line); padding: 12px 14px; margin-bottom: 8px;
}
.task input[type="checkbox"] {
  width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--forest); cursor: pointer;
}
.task.done { opacity: .62; }
.task.done .t-title { text-decoration: line-through; }
.task.od { border-left: 4px solid var(--red); }
.t-main { flex: 1; min-width: 0; }
.t-title { font-weight: 700; font-size: 14.5px; }
.meta { font-size: 13px; color: var(--muted); margin-top: 5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.meta em { color: var(--ink-soft); }
.t-cat { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--gold); }
.owner-select {
  font-size: 12.5px; font-weight: 700; padding: 4px 8px; width: auto;
  background: var(--green-soft); border: 1.5px solid #bfe3cb; color: var(--forest);
}
.doc-note {
  border: 1.5px solid var(--gold); background: var(--gold-soft); color: #6b4d15;
  padding: 12px 16px; font-size: 13.5px; margin-bottom: 14px;
}
.welcome-box {
  background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--gold);
  padding: 14px 18px; margin: 12px 0; font-size: 14px; white-space: pre-wrap;
}

/* ============ notes & pulse ============ */
.notes-sect { margin-top: 22px; border-top: 2px dashed var(--line); padding-top: 14px; }
.notes-sect h3 { margin: 0 0 12px; font-size: 16px; }
.note-add { margin-bottom: 12px; }
.note-item {
  background: #fff; border: 1px solid var(--line); padding: 10px 14px; margin-bottom: 8px;
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
}
.note-text { font-size: 14px; flex: 1; }
.note-meta { display: flex; gap: 10px; align-items: center; flex: none; }

/* ============ lists & nudges ============ */
.list-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14.5px;
}
.list-item:last-child { border-bottom: none; }
.nudge-card { border-top-color: var(--gold); }
.nudge-item { align-items: flex-start; }

/* ============ footer ============ */
.foot { margin: 26px 0 0; padding-bottom: 36px; font-size: 12.5px; color: var(--faint); }

/* ============ print ============ */
@media print {
  .topbar, .foot, .form-row, .btn, .note-add, .nudge-card { display: none !important; }
  body.print-hire .view { display: none; }
  body.print-hire #view-dashboard { display: block; }
  body.print-hire #hireDetail { display: block; }
}

/* ============ motion ============ */
@media (prefers-reduced-motion: no-preference) {
  .view.active { animation: fadein .25s ease both; }
  .hire-card { animation: rise .3s ease both; }
  @keyframes fadein { from { opacity: 0; } }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } }
}

/* ============ responsive ============ */
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .topbar { width: 100%; height: auto; position: static; }
  .topbar-inner { padding: 18px 16px 14px; gap: 10px; }
  .nav { flex-direction: row; overflow-x: auto; }
  .nav button { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; padding: 10px 12px; }
  .nav button.active { border-bottom-color: var(--gold); }
  .local-pill { margin-top: 0; }
  .wrap { padding: 22px 16px 0; }
  .detail-progress { margin-left: 0; width: 100%; }
  .journey { flex-direction: column; gap: 14px; }
  .station { text-align: left; padding: 0 0 0 34px; }
  .station::before { left: 9px; top: -14px; width: 3px; height: 100%; }
  .station:first-child::before { display: none; }
  .pin { left: 0; top: 0; transform: none; }
}
