/* =========================================================
   PathwayPro Missions : Heads Team board
   Palette is the PathwayPro one: ink, mist, gold, terracotta,
   rust, sage. Person colours live in js/team.js.
   ========================================================= */

:root {
  --ink: #253238;
  --ink-2: #3a4a52;
  --ink-3: #6b7b83;
  --mist: #b9b9c3;
  --gold: #cca300;
  --terra: #c76639;
  --rust: #983400;
  --sage: #a2b4b4;

  --paper: #f4f2ed;
  --paper-2: #faf9f6;
  --card: #ffffff;
  --line: #e2ded5;
  --line-2: #ece9e2;

  --shadow-sm: 0 1px 2px rgba(37, 50, 56, .06), 0 2px 8px rgba(37, 50, 56, .05);
  --shadow-md: 0 8px 24px rgba(37, 50, 56, .12);
  --shadow-lg: 0 24px 60px rgba(37, 50, 56, .22);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --rail-w: 320px;
  --top-h: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
.hidden { display: none !important; }

.ic {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
  display: block;
}
.ic-sm { width: 14px; height: 14px; stroke-width: 2.1; }

/* ---------- Wordmark ----------
   Set to match the supplied logo: "Pathway" hollow in mist grey, "Pro" solid
   in slate, a circled TM riding the cap line, then "MISSION" solid black and
   hard up against it. Text rather than an image so it stays crisp at any size
   and can be recoloured per surface. */
.wordmark {
  display: inline-flex; align-items: center;
  font-weight: 900; letter-spacing: -.035em; font-size: 20px; line-height: 1;
  white-space: nowrap;
}
.wm-pathway {
  color: transparent;
  -webkit-text-stroke: 1.4px var(--mist);
  paint-order: stroke fill;
}
.wm-pro { color: var(--ink); }
.wm-tm {
  display: inline-grid; place-items: center;
  width: .58em; height: .58em; margin: 0 .04em;
  border: .055em solid var(--ink); border-radius: 99px;
  color: var(--ink); font-size: .62em; font-weight: 800; letter-spacing: -.04em;
  align-self: flex-start; transform: translateY(-.14em);
}
.wm-tm span { font-size: .52em; transform: translateY(-.02em); }
.wm-app { color: #0b0b0b; letter-spacing: -.03em; }

.wordmark-lg { font-size: 34px; }

/* On the dark sign-out row the outline needs to lift off the paper a little. */
.topbar .wordmark { font-size: 19px; }

/* =========================================================
   Gate
   ========================================================= */
.gate {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 500px at 15% -10%, #efe6cf 0%, transparent 60%),
    radial-gradient(800px 600px at 110% 10%, #f0d9cc 0%, transparent 55%),
    linear-gradient(160deg, var(--paper) 0%, #e6e6e2 100%);
}
.gate-card {
  width: min(460px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px 32px;
  text-align: center;
}
.gate-lead { margin-top: 18px; color: var(--ink-2); line-height: 1.55; font-size: 14.5px; }
.gate-card h1 { margin-top: 18px; font-size: 20px; letter-spacing: -.01em; }
.gate-actions { margin-top: 22px; display: grid; gap: 10px; }
.gate-fine { margin-top: 18px; font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.gate-fine a, .linkish { color: var(--rust); text-decoration: underline; cursor: pointer; }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--r-sm);
  font-weight: 650; font-size: 14px; letter-spacing: -.01em;
  border: 1px solid transparent; transition: transform .08s, background .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #16232a; }
.btn-ghost { background: var(--card); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--mist); }
.btn-danger-ghost { background: none; color: var(--rust); border-color: transparent; }
.btn-danger-ghost:hover { background: #fbeeea; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-block { width: 100%; }

.icon-btn {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: var(--r-sm);
  color: var(--ink-2); flex: 0 0 auto;
}
.icon-btn:hover { background: #00000009; color: var(--ink); }

/* =========================================================
   Shell + topbar
   ========================================================= */
.shell { height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: var(--top-h); flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}
.topbar-sub {
  font-size: 12.5px; color: var(--ink-3); font-weight: 550;
  padding-left: 12px; border-left: 1px solid var(--line);
}
.topbar-spacer { flex: 1 1 auto; }

.counters { display: flex; gap: 8px; }
.count-pill {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 4px 10px; border-radius: 99px;
  background: #fff; border: 1px solid var(--line);
  font-size: 12px; color: var(--ink-3); font-weight: 550;
}
.count-pill b { font-size: 13px; color: var(--ink); font-weight: 750; }
.count-pill.is-hot { border-color: #e6bfae; background: #fdf1ec; color: var(--rust); }
.count-pill.is-hot b { color: var(--rust); }

.viewswitch {
  display: flex; padding: 3px; gap: 3px;
  background: #eceae4; border-radius: var(--r-sm);
}
.vs-btn {
  padding: 6px 14px; border-radius: 6px;
  font-size: 13px; font-weight: 650; color: var(--ink-3);
}
.vs-btn.is-on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

.who {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 6px; border-radius: 99px;
  background: #fff; border: 1px solid var(--line);
  font-size: 13px; font-weight: 650;
}
.who .dot { width: 22px; height: 22px; border-radius: 99px; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 800; }

.banner {
  flex: 0 0 auto;
  padding: 9px 18px; font-size: 13px; font-weight: 550;
  background: #fdf6e3; color: #7a5c00; border-bottom: 1px solid #ecdfb8;
}
.banner b { font-weight: 750; }

/* =========================================================
   Workspace
   ========================================================= */
.workspace { flex: 1 1 auto; display: flex; min-height: 0; }

/* ---------- Rail ---------- */
.rail {
  width: var(--rail-w); flex: 0 0 var(--rail-w);
  display: flex; flex-direction: column; min-height: 0;
  background: var(--paper-2);
  border-right: 1px solid var(--line);
}
.rail-head {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 16px 0;
}
.rail-head h2 { font-size: 15px; font-weight: 750; letter-spacing: -.01em; }
.rail-count {
  padding: 1px 8px; border-radius: 99px;
  background: var(--ink); color: #fff; font-size: 11.5px; font-weight: 750;
}
.rail-note { padding: 6px 16px 12px; font-size: 12px; color: var(--ink-3); line-height: 1.45; }

.quickadd { padding: 0 16px 12px; }
.quickadd input[type=text] {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #fff; font-size: 13.5px; outline: none;
}
.quickadd input[type=text]:focus { border-color: var(--ink-3); box-shadow: 0 0 0 3px #25323812; }
.qa-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.qa-kind { display: flex; background: #eceae4; border-radius: 7px; padding: 2px; gap: 2px; }
.kind-btn { padding: 4px 8px; border-radius: 5px; font-size: 11.5px; font-weight: 650; color: var(--ink-3); }
.kind-btn.is-on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.qa-owner { display: flex; gap: 4px; margin-left: auto; }
.ownerdot {
  width: 24px; height: 24px; border-radius: 99px;
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 800; color: #fff;
  opacity: .38; transition: opacity .12s, transform .12s;
  border: 2px solid transparent;
}
.ownerdot:hover { opacity: .75; }
.ownerdot.is-on { opacity: 1; transform: scale(1.06); border-color: #fff; box-shadow: 0 0 0 2px currentColor; }
.qa-go {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  display: grid; place-items: center; background: var(--ink); color: #fff;
}
.qa-go:hover { background: #16232a; }

.rail-list {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  padding: 4px 12px 24px;
  display: flex; flex-direction: column; gap: 8px;
}

/* ---------- Stage ---------- */
.stage { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.filters {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; border-bottom: 1px solid var(--line-2);
  background: var(--paper);
}
.filters-label { font-size: 11px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px 4px 7px; border-radius: 99px;
  border: 1px solid var(--line); background: #fff;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.chip .swatch { width: 10px; height: 10px; border-radius: 99px; }
.chip.is-on { border-color: var(--ink); background: var(--ink); color: #fff; }
.toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.toggle input { accent-color: var(--ink); width: 15px; height: 15px; }

/* ---------- Matrix ---------- */
.matrix-wrap {
  flex: 1 1 auto; min-height: 0;
  display: grid;
  grid-template-columns: 26px 1fr;
  grid-template-rows: 26px 1fr;
  gap: 4px; padding: 14px 18px 18px;
}
.axis { display: flex; color: var(--ink-3); font-size: 10.5px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.axis-x { grid-column: 2; grid-row: 1; align-items: center; }
.axis-x span { flex: 1 1 0; text-align: center; }
.axis-y { grid-column: 1; grid-row: 2; flex-direction: column; }
.axis-y span {
  flex: 1 1 0; display: grid; place-items: center;
  writing-mode: vertical-rl; transform: rotate(180deg);
}

.matrix {
  grid-column: 2; grid-row: 2; min-height: 0;
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 12px;
}
.quad {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--q, var(--mist));
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.q-do { --q: var(--rust); }
.q-schedule { --q: var(--gold); }
.q-delegate { --q: var(--terra); }
.q-drop { --q: var(--sage); }

.quad > header {
  display: flex; align-items: baseline; gap: 8px;
  padding: 11px 14px 9px; border-bottom: 1px solid var(--line-2);
}
.quad h3 { font-size: 14px; font-weight: 750; letter-spacing: -.01em; }
.q-sub { font-size: 11.5px; color: var(--ink-3); }
.q-count {
  margin-left: auto; padding: 1px 8px; border-radius: 99px;
  background: #f1efe9; color: var(--ink-2); font-size: 11.5px; font-weight: 750;
}
.quad-list {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  padding: 10px; display: flex; flex-direction: column; gap: 8px;
}

/* ---------- Drop feedback ---------- */
.is-dropzone { background: #fbf7ec; outline: 2px dashed var(--gold); outline-offset: -4px; border-radius: var(--r-sm); }
.rail-list.is-dropzone, .quad-list.is-dropzone { outline-offset: -6px; }
.drop-marker { height: 3px; border-radius: 99px; background: var(--rust); flex: 0 0 auto; }

.zone-empty {
  margin: auto; padding: 14px; text-align: center;
  font-size: 12px; color: var(--mist); line-height: 1.5;
}
.rail-list .zone-empty { margin: 10px auto 0; }

/* ---------- Card ---------- */
.card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--own, var(--mist));
  border-radius: var(--r-sm);
  padding: 9px 11px 9px 12px;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
  transition: box-shadow .12s, transform .12s, opacity .12s;
  flex: 0 0 auto;
}
.card:hover { box-shadow: var(--shadow-md); }
.card.is-ghosted { opacity: .28; }
.card.is-flying {
  position: fixed; z-index: 90; pointer-events: none;
  cursor: grabbing; width: 280px;
  box-shadow: var(--shadow-lg); transform: rotate(-1.4deg) scale(1.02);
}
.card.is-done { background: #fbfaf8; }
.card.is-done .card-title { text-decoration: line-through; color: var(--ink-3); }

/* The right pad is the tick's seat, so it never lands on the type tag. */
.card-top { display: flex; align-items: flex-start; gap: 8px; padding-right: 24px; }
.card-title { font-size: 13.2px; line-height: 1.4; font-weight: 600; letter-spacing: -.005em; word-break: break-word; flex: 1 1 auto; }
.card-kind {
  flex: 0 0 auto; margin-top: 1px;
  font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  padding: 2px 5px; border-radius: 4px;
  background: #f1efe9; color: var(--ink-3);
}
.card-kind.k-issue { background: #fbeeea; color: var(--rust); }

.card-meta { display: flex; align-items: center; gap: 7px; margin-top: 8px; flex-wrap: wrap; }
.owner-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; color: var(--own, var(--ink-3));
}
.owner-pill .swatch { width: 8px; height: 8px; border-radius: 99px; background: currentColor; }
.due {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: var(--ink-3);
  padding: 2px 7px; border-radius: 99px; background: #f4f2ed;
}
.due.is-soon { background: #fdf6e3; color: #866200; }
.due.is-late { background: #fbeeea; color: var(--rust); }
.status-tag {
  font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px;
  background: #eef3f3; color: #3f7d78;
}
.status-tag.s-done { background: #eef2ee; color: #4a7a4a; }

.card-tick {
  position: absolute; top: 7px; right: 7px;
  width: 20px; height: 20px; border-radius: 99px;
  display: grid; place-items: center;
  border: 1.6px solid var(--line); color: transparent; background: #fff;
  opacity: 0; transition: opacity .12s;
}
.card:hover .card-tick { opacity: 1; }
.card-tick:hover { border-color: #4a7a4a; color: #4a7a4a; }
.card.is-done .card-tick { opacity: 1; border-color: #4a7a4a; background: #4a7a4a; color: #fff; }

/* =========================================================
   Calendar
   ========================================================= */
.cal-wrap { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 14px 18px 18px; }
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-head h3 { font-size: 16px; font-weight: 750; min-width: 190px; text-align: center; letter-spacing: -.01em; }
.cal-note { margin-left: auto; font-size: 12px; color: var(--ink-3); }

.cal-dows { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-dows span { font-size: 10.5px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); text-align: center; }

.cal-grid {
  flex: 1 1 auto; min-height: 0;
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
.cal-day {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 5px 6px; display: flex; flex-direction: column; gap: 3px;
  min-height: 0; overflow: hidden;
}
.cal-day.is-out { background: #f7f5f1; border-color: var(--line-2); }
.cal-day.is-today { border-color: var(--rust); box-shadow: 0 0 0 1px var(--rust) inset; }
.cal-day.is-weekend { background: #f9f8f5; }
.cal-daynum { font-size: 11.5px; font-weight: 700; color: var(--ink-3); flex: 0 0 auto; }
.cal-day.is-today .cal-daynum { color: var(--rust); }
.cal-items { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; min-height: 0; }
.cal-item {
  display: flex; align-items: center; gap: 5px;
  padding: 3px 6px; border-radius: 5px;
  background: #fff; border: 1px solid var(--line-2);
  border-left: 3px solid var(--own, var(--mist));
  font-size: 11px; font-weight: 600; line-height: 1.25;
  cursor: grab; touch-action: none;
  user-select: none; -webkit-user-select: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.is-dragging { user-select: none; -webkit-user-select: none; }
.cal-item.is-done { opacity: .5; text-decoration: line-through; }
.cal-item:hover { border-color: var(--mist); }
.cal-more { font-size: 10px; color: var(--ink-3); padding-left: 4px; }
.cal-day.is-dropzone { background: #fbf7ec; border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }

/* =========================================================
   Drawer
   ========================================================= */
.scrim { position: fixed; inset: 0; background: rgba(37, 50, 56, .32); z-index: 70; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 80;
  width: min(430px, 100%);
  background: var(--paper-2);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: slide-in .18s ease-out;
}
@keyframes slide-in { from { transform: translateX(20px); opacity: .4; } to { transform: none; opacity: 1; } }

.drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px 18px; border-bottom: 1px solid var(--line); }
.drawer-kind {
  font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 5px; background: var(--ink); color: #fff;
}
.drawer-head .icon-btn { margin-left: auto; }

.drawer-body { flex: 1 1 auto; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld > span { font-size: 11px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.fld input, .fld select, .fld textarea {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #fff; font-size: 13.5px; outline: none; resize: vertical;
}
.fld textarea { line-height: 1.5; }
.fld input:focus, .fld select:focus, .fld textarea:focus { border-color: var(--ink-3); box-shadow: 0 0 0 3px #25323812; }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.owner-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.owner-opt {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px 6px 8px; border-radius: 99px;
  border: 1px solid var(--line); background: #fff;
  font-size: 13px; font-weight: 650; color: var(--ink-2);
}
.owner-opt .swatch { width: 12px; height: 12px; border-radius: 99px; }
.owner-opt.is-on { border-color: currentColor; box-shadow: 0 0 0 1px currentColor inset; }

.drawer-meta { font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }
.drawer-foot { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--paper-2); }
.foot-spacer { flex: 1 1 auto; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 95; padding: 10px 18px; border-radius: 99px;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-md);
}

/* =========================================================
   Narrow screens
   ========================================================= */
@media (max-width: 1000px) {
  body { overflow: auto; }
  .shell { height: auto; min-height: 100vh; }
  .workspace { flex-direction: column; }
  .rail { width: auto; flex: 0 0 auto; border-right: none; border-bottom: 1px solid var(--line); }
  .rail-list { max-height: 40vh; }
  .matrix { grid-template-columns: 1fr; grid-template-rows: none; }
  .matrix-wrap { grid-template-columns: 1fr; grid-template-rows: none; }
  .axis { display: none; }
  .matrix-wrap .matrix { grid-column: 1; grid-row: 1; }
  .quad-list { min-height: 90px; }
  .cal-grid { min-height: 520px; }
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 12px; }
  .topbar-sub, .counters { display: none; }
}
