/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg:      #f5f0eb;   /* eggshell white */
  --surface: #ece6d8;   /* slightly deeper eggshell */
  --surface-hover: #e0dac8; /* hover */
  --surface-active: #d4ceb8; /* active/pressed */
  --border:  #c8c0b4;   /* warm beige */
  --text:    #1e1e1e;   /* near-black */
  --dim:     #7a756a;   /* sepia grey */
  --green:   #4a7a4a;   /* in progress */
  --amber:   #8b6f4a;   /* arrived */
  --red:     #8b3a3a;   /* bumped */
  --gray:    #7a7a7a;   /* done */
  --focus:   #4a6a8a;   /* focus ring */
  --bg-pending:     transparent;
  --bg-arrived:     #f5e8d0;
  --bg-in-progress: #e0f0dc;
  --bg-completed:   transparent;
  --bg-bumped:      #f5d8d0;
}
html { background: var(--bg); color: var(--text); }
body {
  font-family: 'Courier New', 'Menlo', 'JetBrains Mono', monospace;
  font-size: 18px; line-height: 1.45;
  min-height: 100vh; display: flex; flex-direction: column;
  padding: 1rem;
}

/* ── Skip link ── */
.skip-link {
  position: absolute; top: -100%; left: 0; z-index: 1000;
  background: var(--text); color: var(--bg); padding: 0.5em 1em;
}
.skip-link:focus { top: 0; }

/* ── Focus ring ── */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ── Login ── */
.login-card {
  width: 24em;
  margin: 4rem auto;
}
.login-card label { color: var(--dim); }
.login-card input {
  display: block; width: 100%;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font-family: inherit; font-size: 1em;
  padding: 0.35em 0.5em;
}
.login-card button {
  display: inline-block; margin-top: 0.5em; padding: 0.25em 0.75em;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font-family: inherit; font-size: 1em; cursor: pointer;
}
.error-msg { color: var(--red); font-size: 0.85em; margin-top: 0.3em; }

/* ── Board header ── */
.board-header {
  display: flex; gap: 1.5em; align-items: baseline;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5em;
}
.board-title { font-weight: bold; font-size: 1.1em; }
.board-date { color: var(--dim); display: flex; align-items: center; gap: 0.4em; }
.board-date .date-nav { text-decoration: none; color: var(--dim); }
.board-date .date-nav:hover { color: var(--text); }
.board-clock { color: var(--dim); }
.board-role { font-style: italic; }
.board-role.viewer { color: var(--dim); }
.board-role.admin { color: var(--green); }

.board-exit {
  font-size: 0.85em;
}

/* ── Controls bar (admin) ── */
.controls-bar {
  display: flex; gap: 0.75em; margin: 0.75em 0;
}

/* ── Shoot rows ── */
.shoot-row {
  display: grid;
  grid-template-columns: auto auto auto auto 1fr auto;
  gap: 0 1rem;
  margin: 2rem 0;
  align-items: baseline;
  padding: 0.4em 0.6em;
  border-radius: 4px;
  min-width: 0;
}
.shoot-row.status-pending     { background: var(--bg-pending); }
.shoot-row.status-arrived     { background: var(--bg-arrived); }
.shoot-row.status-in_progress { background: var(--bg-in-progress); }
.shoot-row.status-completed   { background: var(--bg-completed); color: var(--gray); }
.shoot-row.status-bumped      { background: var(--bg-bumped);    color: var(--red); }

.shoot-time   { color: var(--dim); }
.shoot-glyph  { }
.shoot-status { color: var(--dim); overflow-wrap: break-word; word-break: break-word; }
.shoot-name   { font-weight: bold; overflow-wrap: break-word; word-break: break-word; }
.shoot-note   { color: var(--dim); font-style: italic; overflow-wrap: break-word; word-break: break-word; }
.shoot-elapsed { color: var(--dim); font-size: 0.85em; }

.shoot-actions {
  grid-column: 1 / -1;
  display: flex; gap: 1rem;
  margin-top: 0.6rem;
  padding-left: 0.2em;
}
/* ── Buttons ── */
.btn,
button:not(.btn),
.act,
.board-exit,
.controls-bar-btn {
  display: inline-block;
  font-family: inherit; font-size: inherit;
  padding: 0.2em 0.5em;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  line-height: 1.35;
}
.btn:hover,
button:hover:not(.btn),
.act:hover,
.board-exit:hover,
.controls-bar-btn:hover { background: var(--surface-hover); }
.btn:active,
button:active:not(.btn),
.act:active,
.board-exit:active,
.controls-bar-btn:active { background: var(--surface-active); }

.act { font-size: 0.85em; }
.act.primary { color: var(--green); font-weight: bold; }

/* ── Button variants ── */
.btn-primary,
.act.primary { color: var(--green); font-weight: bold; }
.btn-primary:hover,
.act.primary:hover { background: var(--surface-hover); }
.btn-amber { color: var(--amber); }
.btn-amber:hover { background: var(--surface-hover); }
.btn-dim { color: var(--dim); }
.btn-dim:hover { background: var(--surface-hover); }
.btn-red { color: var(--red); }
.btn-red:hover { background: var(--surface-hover); }

.btn[aria-disabled="true"],
button[disabled]:not(.btn) { color: var(--dim); cursor: default; background: var(--surface); pointer-events: none; opacity: 0.6; }

.shoot-notes {
  grid-column: 1 / -1;
  color: var(--dim); font-style: italic;
  padding-left: 0.2em; font-size: 0.85em;
}

/* ── Status glyph colours ── */
.shoot-glyph { font-weight: bold; }
.shoot-row.status-pending     .shoot-glyph { color: var(--dim); }
.shoot-row.status-arrived     .shoot-glyph { color: var(--amber); }
.shoot-row.status-in_progress .shoot-glyph { color: var(--green); }
.shoot-row.status-completed   .shoot-glyph { color: var(--gray); }
.shoot-row.status-bumped      .shoot-glyph { color: var(--red); }

.shoot-row.status-in_progress .shoot-status { color: var(--green); font-weight: bold; }
.shoot-row.status-arrived     .shoot-status { color: var(--amber); }
.shoot-row.status-bumped      .shoot-status { color: var(--red); }

/* ── Separator between active and completed/bumped ── */
.separator {
  margin: 0.35em 0;
  color: var(--dim);
}

/* ── Empty state ── */
.empty-state { margin: 2em 0; color: var(--dim); }
.empty-state strong { color: var(--text); }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.25);
  display: none; align-items: center; justify-content: center;
  z-index: 100;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg); border: 1px solid var(--border);
  padding: 1.5em; max-width: 94vw;
}
.modal label {
  display: inline-block; width: 5em;
  color: var(--dim); margin-right: 0.5em;
}
.modal input {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font-family: inherit; font-size: 1em;
  padding: 0.2em 0.4em;
}
.modal .modal-line {
  margin-bottom: 0.4em;
}
.modal .modal-actions {
  display: flex; gap: 0.5em; margin-top: 0.5em;
}
.modal .modal-actions button {
  font-size: 1em;
}
.modal .modal-actions button.cancel { color: var(--dim); font-weight: normal; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .shoot-row {
    font-size: 0.9em;
  }
  .shoot-status {
    font-size: 0.75em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}