/* Shop floor first: big enough to read standing up, at a machine, in bad light. */

:root {
  --bg:     #0f1115;
  --panel:  #171a21;
  --line:   #262b36;
  --ink:    #e7eaf0;
  --dim:    #8d95a5;
  --accent: #2f7de1;
  --good:   #2f9e5f;
  --warn:   #c9872b;
  --bad:    #c4443c;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
}

/* --- header ------------------------------------------------------------ */
/* [hidden] must win over display:flex, or the nav shows on the sign-in screen. */
[hidden] { display: none !important; }

header {
  display: flex; align-items: center; gap: 28px;
  padding: 0 20px; height: 60px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; letter-spacing: .04em; font-size: 15px; }
.brand span { color: var(--dim); font-weight: 500; margin-left: 6px; }
header nav { display: flex; gap: 4px; margin-right: auto; }
header nav a {
  color: var(--dim); text-decoration: none; padding: 8px 14px;
  border-radius: 6px; font-weight: 500;
}
header nav a:hover { color: var(--ink); background: #1e222b; }
header nav a.on { color: var(--ink); background: #1e222b; }
.who { display: flex; align-items: center; gap: 14px; color: var(--dim); font-size: 14px; }

/* --- layout ------------------------------------------------------------ */
main { padding: 24px 20px 64px; max-width: 1100px; margin: 0 auto; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 28px 0 10px; }
.sub { color: var(--dim); margin: 0 0 20px; font-size: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.loading, .empty { color: var(--dim); padding: 32px 0; }
.empty b { color: var(--ink); display: block; margin-bottom: 4px; font-weight: 600; }

/* --- tables ------------------------------------------------------------ */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 11px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--dim); font-weight: 600;
  padding: 8px 10px; border-bottom: 1px solid var(--line);
}
td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.click:hover { background: #1b1f27; cursor: pointer; }
.mono { font-family: var(--mono); }
.dim { color: var(--dim); }
.num { text-align: right; font-family: var(--mono); }

/* --- pills -------------------------------------------------------------- */
.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .03em;
  border: 1px solid var(--line); color: var(--dim); white-space: nowrap;
}
.pill.planned   { color: var(--dim); }
.pill.released  { color: #7fb2ef; border-color: #27405f; }
.pill.running   { color: var(--good); border-color: #23462f; }
.pill.hold      { color: var(--warn); border-color: #4a3a1c; }
.pill.complete  { color: var(--dim); }
.pill.cancelled { color: var(--bad); border-color: #4a2523; }
.pill.flight    { color: var(--warn); border-color: #4a3a1c; }
.pill.warn      { color: var(--warn); border-color: #4a3a1c; }
.pill.queued    { color: var(--dim); }
.pill.current   { color: var(--good); border-color: #23462f; }
.pill.draft     { color: var(--warn); border-color: #4a3a1c; }
.pill.superseded, .pill.obsolete { color: var(--bad); border-color: #4a2523; }

/* --- forms -------------------------------------------------------------- */
label { display: block; font-size: 12px; color: var(--dim); margin: 0 0 5px; font-weight: 500; }
input, select, textarea {
  background: #11141a; border: 1px solid var(--line); color: var(--ink);
  padding: 10px 12px; border-radius: 6px; font: inherit; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.field { margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

button {
  background: var(--accent); color: #fff; border: 0; padding: 10px 18px;
  border-radius: 6px; font: inherit; font-weight: 600; cursor: pointer;
}
button:hover { filter: brightness(1.1); }
button[disabled] { opacity: .5; cursor: default; filter: none; }
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
button.link { background: none; border: 0; color: var(--dim); padding: 0; font-weight: 500; }
button.link:hover { color: var(--ink); }
button.big { padding: 14px 22px; font-size: 17px; }
button.stop { background: var(--bad); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }

/* --- type-to-search picker --------------------------------------------- */
.picker { position: relative; }
.pick-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20;
  background: #11141a; border: 1px solid var(--line); border-radius: 8px;
  max-height: 290px; overflow-y: auto; box-shadow: 0 12px 30px rgba(0,0,0,.5);
}
.pick-row {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  color: var(--ink); padding: 10px 12px; font: inherit; font-weight: 400;
  border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 0;
}
.pick-row:last-child { border-bottom: 0; }
.pick-row:hover { background: #1b2230; filter: none; }

/* --- sign in ------------------------------------------------------------ */
.signin { max-width: 360px; margin: 10vh auto; }
.signin .brand { font-size: 20px; margin-bottom: 6px; }
.err { color: #ff9d96; font-size: 14px; margin: 10px 0 0; }

/* --- traveler ----------------------------------------------------------- */
.job-head { border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 4px; }
.job-head .no { font-family: var(--mono); font-size: 28px; font-weight: 600; }
.facts { display: flex; gap: 32px; flex-wrap: wrap; margin-top: 12px; }
.fact .k { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.fact .v { font-size: 17px; margin-top: 2px; }
.op { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 10px; }
.op .seq { font-family: var(--mono); color: var(--dim); font-size: 13px; }
.op .desc { font-size: 17px; font-weight: 500; margin: 2px 0 8px; }
.clock { font-family: var(--mono); font-size: 15px; color: var(--good); }

/* --- toast -------------------------------------------------------------- */
#toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--line); color: var(--ink);
  padding: 12px 20px; border-radius: 8px; font-size: 14px; z-index: 50;
  max-width: 90vw;
}
#toast.bad { border-color: #4a2523; color: #ff9d96; }

@media (max-width: 680px) {
  /* Columns marked .wide are the ones worth losing first on a narrow screen. */
  .wide { display: none; }
  table { table-layout: fixed; }
  td, th { word-break: break-word; }
  header { gap: 12px; padding: 0 12px; }
  header nav a { padding: 8px 10px; }
  .who span { display: none; }
  main { padding: 16px 12px 64px; }
  .grid2 { grid-template-columns: 1fr; }
}

/* --- the shop board ------------------------------------------------------
   A screen on a wall is read from eight feet away by someone holding a part.
   Nothing subtle survives that, so everything here is bigger than it looks
   like it should be. */
.board-mode main { max-width: none; padding: 20px 24px 40px; }
.board-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.board-mode h1 { font-size: 30px; }

.board { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 5px solid var(--line); border-radius: 10px; padding: 16px 18px;
}
.card.soon  { border-left-color: var(--warn); }
.card.today { border-left-color: var(--accent); }
.card.late  { border-left-color: var(--bad); }

.card-no   { font-size: 15px; color: var(--dim); letter-spacing: .04em; }
.card-due  { font-size: 14px; font-weight: 600; color: var(--dim); white-space: nowrap; }
.card-due.soon  { color: var(--warn); }
.card-due.today { color: var(--accent); }
.card-due.late  { color: var(--bad); }
.card-part { font-size: 26px; font-weight: 600; margin: 6px 0 2px; line-height: 1.15; }
.card-cust { font-size: 16px; color: var(--dim); }
.card-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 14px; color: var(--dim); }
.card-next { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 15px; }
.card-next .clock { color: var(--good); font-weight: 600; }

@media (max-width: 680px) {
  .board { grid-template-columns: 1fr; }
  .card-part { font-size: 22px; }
}

/* --- job list ------------------------------------------------------------
   Cards, not table rows. A row does not look like something you can open,
   and at shop width the columns wrapped into an unreadable stack. */
.joblist { display: flex; flex-direction: column; gap: 10px; }
.jobrow {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; text-align: left; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
  color: var(--ink); font: inherit; font-weight: 400; cursor: pointer;
}
.jobrow:hover { background: #1b1f27; border-color: #333b4a; filter: none; }
.jobrow-main { min-width: 0; }
.jobrow-part { font-size: 19px; font-weight: 600; margin: 7px 0 3px; }
.jobrow-go { white-space: nowrap; font-size: 14px; }

/* --- download ------------------------------------------------------------
   The operator is holding a USB stick. Make the thing they want obvious. */
.dlbtn {
  display: inline-block; background: var(--accent); color: #fff;
  padding: 8px 16px; border-radius: 6px; font-weight: 600; font-size: 14px;
  text-decoration: none; white-space: nowrap;
}
.dlbtn:hover { filter: brightness(1.1); }

/* --- notes ---------------------------------------------------------------
   A standing note is marked, because "always true" and "that happened once"
   are different things and must not look the same. */
.note {
  border: 1px solid var(--line); border-left: 3px solid var(--line);
  border-radius: 8px; padding: 13px 15px; margin-bottom: 10px;
}
.note.standing { border-left-color: var(--warn); background: #1a1812; }
.note-body { font-size: 16px; line-height: 1.5; }
.note-foot {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-top: 10px; font-size: 13px;
}

/* --- video thumbnail ---------------------------------------------------- */
.thumb { position: relative; display: block; flex: 0 0 auto; line-height: 0; }
.thumb img {
  width: 128px; height: 72px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--line);
}
.thumb .play {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; color: #fff; font-size: 24px;
  text-shadow: 0 2px 10px rgba(0,0,0,.8);
}

/* Edit and Delete sit apart from the promote buttons: one pair changes the
   note, the other changes where it lives. Different jobs, different corner. */
.note-own { margin-left: auto; display: flex; gap: 14px; }
.note textarea { font: inherit; }

@media (max-width: 680px) {
  .note-own { margin-left: 0; width: 100%; }
}

/* --- team --------------------------------------------------------------- */
/* A person is a card, not a table row. There will never be enough people for
   a table to earn its density, and a row cannot hold the "no login yet" note
   without going to pieces. */
.person {
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); padding: 14px 16px; margin-bottom: 10px;
}
.person.off { opacity: .6; }
.person-name {
  display: flex; align-items: center; gap: 8px;
  font-size: 17px; font-weight: 600;
}
.person-mail { font-size: 13px; color: var(--dim); margin-top: 3px; }
.person-roles { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 11px; }
.pill.role     { color: #7fb2ef; border-color: #27405f; }
.pill.switched { color: var(--bad); border-color: #4a2523; }

/* The step this screen cannot take for you. Amber, like a standing note,
   because it is the same kind of thing: something you must act on. */
.person-wait {
  margin-top: 12px; padding: 11px 13px;
  border-left: 3px solid var(--warn); background: #1a1812;
  border-radius: 0 7px 7px 0; font-size: 14px; line-height: 1.6;
}
.person-wait b { color: var(--ink); }
.person-wait a { display: inline-block; margin-top: 7px; color: var(--accent); }

.role-edit { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
/* label is display:block globally, and every input is width:100% — both have
   to be undone here or the checkboxes become full-width bars. */
.role-row {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 7px 0; margin: 0; cursor: pointer;
  font-size: 15px; color: var(--ink);
}
.role-row input[type="checkbox"] {
  width: 18px; height: 18px; flex: none; margin: 2px 0 0; accent-color: var(--accent);
}
.role-row b { font-weight: 600; }
.role-row .dim { font-size: 13px; }

/* Setting a password, and the hand-over panel it becomes. Green rather than
   amber: amber is "you still have something to do", green is "done, now give
   them this". Different states should not look the same. */
.login-form { margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
.login-form .pw { letter-spacing: .08em; font-size: 17px; }

.handover {
  margin-top: 12px; padding: 13px 15px;
  border-left: 3px solid var(--good); background: #121a15;
  border-radius: 0 8px 8px 0;
}
.handover > b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 10px; }
.handover-pair { display: flex; gap: 12px; align-items: baseline; padding: 3px 0; }
.handover-pair .dim {
  min-width: 76px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em;
}
/* One click selects the whole thing — nobody should be dragging across a
   password character by character to copy it. */
.pw-big {
  font-size: 21px; font-weight: 600; letter-spacing: .1em;
  color: var(--ink); user-select: all;
}

@media (max-width: 680px) {
  .handover-pair { flex-direction: column; gap: 2px; }
  .handover-pair .dim { min-width: 0; }
}
