/* Chicago Project members area — pixel-art design system.
   Same tokens as the landing page: squared corners, 4px "pixel" grid, hard
   ink shadows, self-hosted pixel fonts. */

@font-face {
  font-family: "Press Start 2P";
  src: url("/assets/fonts/press-start-2p-latin.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Pixelify Sans";
  src: url("/assets/fonts/pixelify-sans-latin.woff2") format("woff2");
  font-weight: 400 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "VT323";
  src: url("/assets/fonts/vt323-latin.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  --paper: #f6e7c8;
  --paper-2: #f0e0bc;
  --paper-3: #e7d3a6;
  --ink: #28211f;
  --ink-2: #6a523d;
  --red: #ce382a;
  --red-dark: #a1281d;
  --blue: #2a3557;
  --gold: #ecbc5c;
  --green: #2f6b3a;
  --px: 4px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family: "Pixelify Sans", system-ui, sans-serif;
  font-size: 1.0625rem;
  background-color: var(--paper);
  background-image: conic-gradient(var(--paper-2) 25%, transparent 0 50%, var(--paper-2) 0 75%, transparent 0);
  background-size: 16px 16px;
}

h1, h2, h3 {
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.5;
  margin: 0;
}

a { color: var(--red); }

.num { font-family: "VT323", ui-monospace, monospace; letter-spacing: .02em; }

.muted { color: var(--ink-2); }
.small { font-size: .8rem; }
.center { text-align: center; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: 1080px; margin-inline: auto; padding: clamp(16px, 3vw, 32px); }
.centered { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.stack > * + * { margin-top: calc(var(--px) * 3); }

/* ---------- Panels ---------- */
.panel {
  background: var(--paper);
  border: var(--px) solid var(--ink);
  box-shadow: calc(var(--px) * 2) calc(var(--px) * 2) 0 var(--ink);
}
.panel__bar {
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: .72rem;
  line-height: 1.4;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.panel__bar .spacer { margin-left: auto; }
.panel__body { padding: clamp(16px, 3vw, 24px); }

/* ---------- Buttons ---------- */
.btn {
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: .62rem;
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--paper-2);
  border: 3px solid var(--ink);
  box-shadow: var(--px) var(--px) 0 var(--ink);
  cursor: pointer;
  transition: transform 60ms steps(1), box-shadow 60ms steps(1), background-color 60ms;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn--red { background: var(--red); color: var(--paper); }
.btn--dark { background: var(--ink); color: var(--paper); }
.btn--block { width: 100%; }
.btn--tiny { font-size: .5rem; padding: 6px 8px; box-shadow: 2px 2px 0 var(--ink); }

/* ---------- Forms ---------- */
.field { display: block; }
.label {
  display: block;
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: .55rem;
  margin-bottom: 6px;
  color: var(--ink-2);
}
.input, .select, .textarea {
  width: 100%;
  min-width: 0;
  font: inherit;
  color: var(--ink);
  background: #fffdf6;
  border: 3px solid var(--ink);
  padding: 9px 10px;
}
.textarea { min-height: 68px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: 3px dashed var(--red); outline-offset: 2px; }

.turnstile { display: flex; justify-content: center; min-height: 65px; }

input[type="file"].input { padding: 7px 8px; }
input[type="file"].input::file-selector-button {
  font: inherit;
  margin-right: 10px;
  padding: 4px 8px;
  border: 2px solid var(--ink);
  background: var(--paper-2);
  color: var(--ink);
  cursor: pointer;
}

/* ---------- KPI strip ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: calc(var(--px) * 3); }
.kpi {
  background: var(--paper);
  border: var(--px) solid var(--ink);
  box-shadow: var(--px) var(--px) 0 var(--ink);
  padding: 12px;
}
.kpi__label { font-family: "Press Start 2P", ui-monospace, monospace; font-size: .5rem; color: var(--ink-2); line-height: 1.5; }
.kpi__value { font-family: "VT323", ui-monospace, monospace; font-size: 2.4rem; line-height: 1.1; margin-top: 6px; }
.kpi__value.is-money { color: var(--green); }
.kpi__sub { font-size: .8rem; color: var(--ink-2); margin-top: 2px; }

/* ---------- Agents: one compact card ---------- */
.agent-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1.1fr) minmax(0, 1fr) 96px minmax(0, 1.3fr) 92px;
  grid-template-areas: "slot handle niche status notes earned";
  gap: 8px;
  align-items: center;
  padding: 8px 2px;
  border-bottom: 2px dashed var(--paper-3);
}
.agent-row:last-child { border-bottom: 0; }
.agent-head {
  padding-bottom: 6px;
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: .46rem;
  color: var(--ink-2);
  border-bottom: 3px solid var(--ink);
}
.c-slot { grid-area: slot; }
.c-handle { grid-area: handle; }
.c-niche { grid-area: niche; }
.c-status { grid-area: status; }
.c-notes { grid-area: notes; }
.c-earned { grid-area: earned; text-align: right; }
.agent__slot { font-family: "Press Start 2P", ui-monospace, monospace; font-size: .55rem; background: var(--ink); color: var(--paper); padding: 4px 6px; justify-self: start; }
.agent__earned { font-family: "VT323", ui-monospace, monospace; font-size: 1.35rem; }
.agent-row .input, .agent-row .select { padding: 6px 8px; font-size: .95rem; }

/* generic two-column row used by the forms */
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

/* ---------- Status pills ---------- */
.pill { font-family: "Press Start 2P", ui-monospace, monospace; font-size: .48rem; padding: 5px 7px; border: 2px solid var(--ink); }
.pill--active { background: var(--green); color: var(--paper); }
.pill--paused { background: var(--gold); color: var(--ink); }
.pill--idle { background: var(--paper-3); color: var(--ink); }
.pill--todo { background: var(--paper-3); color: var(--ink); }
.pill--doing { background: var(--gold); color: var(--ink); }
.pill--done { background: var(--green); color: var(--paper); }

/* ---------- Lists (ledger + tasks) ---------- */
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: calc(var(--px) * 3); align-items: start; }
.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 2px dashed var(--paper-3);
}
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .money { font-family: "VT323", ui-monospace, monospace; font-size: 1.3rem; color: var(--green); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Team ---------- */
.team { display: flex; flex-wrap: wrap; gap: calc(var(--px) * 2); }
.member { display: flex; align-items: center; gap: 8px; max-width: 100%; overflow: hidden; border: 2px solid var(--ink); background: var(--paper-2); padding: 6px 10px; }
.dot { width: 12px; height: 12px; border: 2px solid var(--ink); }

/* ---------- Messages ---------- */
.notice { border: 3px solid var(--ink); padding: 10px 12px; background: var(--paper-2); }
.notice--error { background: var(--red); color: var(--paper); border-color: var(--ink); }
.notice--ok { background: var(--green); color: var(--paper); }
.pre-line { white-space: pre-line; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: calc(var(--px) * 6);
}
.topbar h1 { font-size: clamp(.9rem, 3vw, 1.15rem); }
.topbar .who { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.section { margin-top: calc(var(--px) * 8); }
.section__title { font-family: "Press Start 2P", ui-monospace, monospace; font-size: .8rem; margin-bottom: calc(var(--px) * 3); display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.section__title .muted { font-family: "Pixelify Sans", sans-serif; font-size: .82rem; }

:focus-visible { outline: 3px dashed var(--red); outline-offset: 3px; }

@media (max-width: 860px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .agent-head { display: none; }
  .agent-row {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    grid-template-areas:
      "slot handle earned"
      "slot niche  status"
      "notes notes notes";
    row-gap: 6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
