/* Booth Planner's ordinary pages (library, home) and the shared pieces the
   planner borrows: buttons, form fields, badges and the modal dialog.
   Everything is scoped to .page (the page itself) or a bp- class, so the
   planner can link this file without it touching the planner's own layout. */

.page, .bp-modal {
  --bp-ink: #1c2430;
  --bp-muted: #5d6877;
  --bp-line: #d9dee5;
  --bp-soft: #f4f6f9;
  --bp-accent: #1f4e9c;
  --bp-accent-dark: #173d7a;
  --bp-accent-soft: #e8eef8;
  --bp-error: #a3241b;
  --bp-error-soft: #fdeceb;
  --bp-warn: #7a4a00;
  --bp-warn-soft: #fff3dc;
  --bp-font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---- page frame ---- */

body.page {
  margin: 0;
  background: var(--bp-soft);
  color: var(--bp-ink);
  font: 15px/1.5 var(--bp-font);
}
.page *, .page *::before, .page *::after { box-sizing: border-box; }
.page [hidden], .bp-modal [hidden] { display: none !important; }

.page-header {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 32px;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--bp-line);
}
.page-brand {
  color: var(--bp-accent);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}
.page-nav { display: flex; gap: 4px; }
.page-nav a {
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--bp-muted);
  font-weight: 600;
  text-decoration: none;
}
.page-nav a:hover { color: var(--bp-ink); background: var(--bp-soft); }
.page-nav a[aria-current="page"] { color: var(--bp-accent); background: var(--bp-accent-soft); }

.page-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 32px 80px;
}
.page h1 { margin: 0; font-size: 26px; font-weight: 700; }
.page h2 { margin: 0 0 16px; font-size: 20px; font-weight: 700; }
.page h3 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }

.page-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}
.page-intro { margin: 4px 0 0; color: var(--bp-muted); }

.page-message {
  margin: 64px auto;
  max-width: 520px;
  padding: 20px 24px;
  background: #fff;
  border: 1px solid var(--bp-line);
  border-radius: 8px;
  text-align: center;
}
.page-message-error { color: var(--bp-error); }

.page-status { min-height: 1.5em; margin: 0 0 12px; color: var(--bp-accent); font-weight: 600; }
.page-status:empty { margin: 0; min-height: 0; }
.page-status.is-error { color: var(--bp-error); }

.page-section {
  margin-top: 48px;
  padding: 28px 32px;
  background: #fff;
  border: 1px solid var(--bp-line);
  border-radius: 10px;
}

/* ---- buttons ---- */

.bp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 16px;
  border: 1px solid var(--bp-line);
  border-radius: 6px;
  background: #fff;
  color: var(--bp-ink);
  font: 600 14px/1.2 var(--bp-font);
  cursor: pointer;
  white-space: nowrap;
}
.bp-btn:hover { border-color: #b8c0cc; background: var(--bp-soft); }
.bp-btn:disabled { opacity: 0.55; cursor: default; }
.bp-btn-primary { border-color: var(--bp-accent); background: var(--bp-accent); color: #fff; }
.bp-btn-primary:hover { border-color: var(--bp-accent-dark); background: var(--bp-accent-dark); }
.bp-btn-quiet { border-color: transparent; background: transparent; color: var(--bp-muted); }
.bp-btn-quiet:hover { border-color: transparent; background: var(--bp-soft); color: var(--bp-ink); }
.bp-btn:focus-visible, .bp-link:focus-visible, .bp-close:focus-visible {
  outline: 2px solid var(--bp-accent);
  outline-offset: 2px;
}

.bp-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--bp-accent);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.bp-link:hover { text-decoration: underline; }

/* ---- badges ---- */

.bp-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: #e6e9ee;
  color: var(--bp-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.bp-badge-warn { background: var(--bp-warn-soft); color: var(--bp-warn); }

.bp-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- tables ---- */

.bp-table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--bp-line);
  border-radius: 10px;
}
.bp-table { width: 100%; border-collapse: collapse; }
.bp-table th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--bp-line);
  color: var(--bp-muted);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.bp-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #eceff3;
  vertical-align: middle;
}
.bp-table tbody tr:last-child td { border-bottom: 0; }

/* ---- form fields ---- */

.page input[type="text"], .page input[type="search"], .page input[type="number"],
.page select, .page textarea,
.bp-modal input[type="text"], .bp-modal input[type="number"], .bp-modal select {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid #c3cad4;
  border-radius: 6px;
  background: #fff;
  color: var(--bp-ink);
  font: 15px/1.4 var(--bp-font);
}
.page textarea { min-height: 0; resize: vertical; }
.page input:focus, .page select:focus, .page textarea:focus,
.bp-modal input:focus, .bp-modal select:focus {
  outline: 2px solid var(--bp-accent);
  outline-offset: 0;
  border-color: var(--bp-accent);
}
.page [aria-invalid], .bp-modal [aria-invalid] { border-color: var(--bp-error); }

.bp-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bp-field > label, .bp-label { font-size: 14px; font-weight: 600; }
.bp-hint { margin: 0; color: var(--bp-muted); font-size: 13px; }
.bp-field-error { margin: 0; color: var(--bp-error); font-size: 13px; font-weight: 600; }
.bp-short { max-width: 120px; }

.bp-row { display: flex; flex-wrap: wrap; gap: 16px; }
.bp-row > .bp-field { flex: 1 1 160px; }

.bp-checks { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.bp-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  cursor: pointer;
}
.bp-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--bp-accent); }
.bp-inline { display: flex; align-items: center; gap: 12px; }

/* ---- modal dialog (the add / edit item form) ---- */

.bp-modal {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: var(--bp-ink);
  font: 15px/1.5 var(--bp-font);
  box-shadow: 0 20px 60px rgba(20, 30, 50, 0.3);
}
.bp-modal *, .bp-modal *::before, .bp-modal *::after { box-sizing: border-box; }
.bp-modal::backdrop { background: rgba(20, 28, 40, 0.45); }
.bp-modal[open] { display: flex; }
.bp-form { display: flex; flex-direction: column; width: 100%; max-height: calc(100vh - 48px); margin: 0; }

.bp-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--bp-line);
}
.bp-modal-head h2 { margin: 0; font-size: 19px; font-weight: 700; }
.bp-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--bp-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.bp-close:hover { background: var(--bp-soft); color: var(--bp-ink); }

.bp-modal-body { flex: 1; overflow-y: auto; padding: 8px 24px 24px; }
.bp-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 24px;
  border-top: 1px solid var(--bp-line);
  background: var(--bp-soft);
  border-radius: 0 0 12px 12px;
}

.bp-form-error {
  margin: 16px 0 0;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--bp-error-soft);
  color: var(--bp-error);
  font-weight: 600;
}

.bp-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.bp-group > legend {
  margin-bottom: 10px;
  padding: 0;
  color: var(--bp-accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.bp-subgroup {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--bp-line);
  border-radius: 8px;
  background: var(--bp-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
}
.bp-subgroup > legend { padding: 0 4px; color: var(--bp-muted); font-size: 13px; font-weight: 600; }

.bp-art { display: flex; gap: 16px; align-items: flex-start; }
.bp-preview {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 90px;
  border: 1px dashed #c3cad4;
  border-radius: 8px;
  background: var(--bp-soft);
  color: var(--bp-muted);
  font-size: 13px;
  overflow: hidden;
}
.bp-preview img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.bp-art-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bp-art-label { font-size: 14px; font-weight: 600; }
.bp-art-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bp-file { font: 14px var(--bp-font); max-width: 100%; }
.bp-colour { width: 52px; height: 34px; padding: 2px; border: 1px solid #c3cad4; border-radius: 6px; background: #fff; }

/* ---- library page ---- */

.lib-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.page .lib-filters select { width: auto; min-width: 140px; }
.page input.lib-search { width: 280px; }
.lib-count { margin-left: auto; color: var(--bp-muted); font-size: 14px; }

.lib-row { cursor: pointer; }
.lib-row:hover td { background: #f7f9fc; }
.lib-row.is-retired td { color: #9aa3af; }
.lib-row.is-retired .lib-thumb { opacity: 0.4; filter: grayscale(1); }
.lib-row.is-retired .bp-link { color: #7c8796; }
.lib-row.just-saved td { background: var(--bp-accent-soft); transition: background 0.6s; }

.lib-col-thumb { width: 72px; }
.lib-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 42px;
  border: 1px solid var(--bp-line);
  border-radius: 5px;
  background: #fff;
  object-fit: contain;
}
.lib-placeholder { background: var(--bp-soft); color: #a3abb7; font-weight: 700; }
.lib-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.lib-size { white-space: nowrap; }
.lib-num { text-align: right; }
.lib-empty { padding: 32px; color: var(--bp-muted); text-align: center; }

/* ---- settings ---- */

.set-form { display: flex; flex-direction: column; gap: 32px; }
.set-part { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.set-part textarea { max-width: 640px; }
.set-rows { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.set-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  padding: 12px 14px;
  border: 1px solid var(--bp-line);
  border-radius: 8px;
}
.set-row-segment > .bp-field:nth-child(1) { flex: 0 1 200px; }
.set-row-segment > .bp-field:nth-child(2) { flex: 1 1 320px; }
.set-row-preset > .bp-field:nth-child(1) { flex: 1 1 220px; }
.set-row-preset > .bp-field:nth-child(2) { flex: 0 0 120px; }
.set-row-preset > .bp-field:nth-child(3), .set-row-preset > .bp-field:nth-child(4) { flex: 0 0 120px; }
.set-remove { margin-left: auto; }
.set-row-error { flex-basis: 100%; }
.set-actions { display: flex; align-items: center; gap: 16px; padding-top: 8px; border-top: 1px solid var(--bp-line); }
.set-actions .page-status { margin: 0; }

/* ---- shared: a button for destructive actions ---- */

.bp-btn-danger { border-color: var(--bp-error); background: var(--bp-error); color: #fff; }
.bp-btn-danger:hover { border-color: #7f1b14; background: #7f1b14; }

/* ---- home page (index.html) ---- */

a.bp-btn { text-decoration: none; }

.home-banner { margin: 0 0 16px; }
.home-shows { display: flex; flex-direction: column; gap: 36px; }

.home-show-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--bp-line);
}
.home-show-head h2 { margin: 0; }
.home-show-facts { margin: 2px 0 0; color: var(--bp-muted); font-size: 14px; }

.home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.home-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--bp-line);
  border-radius: 10px;
}
.home-pic {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  padding: 8px;
  background: #fff;
  border-bottom: 1px solid var(--bp-line);
}
.home-pic img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.home-pic svg { width: 100%; height: 100%; }
.home-pic-none { color: #a3abb7; font-weight: 600; }

.home-card-body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 14px 16px 16px; }
.home-card-body h3 { margin: 0; font-size: 18px; }
.home-booth { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; }
.home-seg[data-segment="FEI"] { background: var(--bp-accent-soft); color: var(--bp-accent); }
.home-seg[data-segment="BPP"] { background: #e4f3ea; color: #1d6b3c; }
.home-saved { margin: 0; color: var(--bp-muted); font-size: 13px; }
.home-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 10px; }
.home-delete { margin-left: auto; }
.home-delete:hover { color: var(--bp-error); }

.home-empty {
  max-width: 560px;
  margin: 48px auto;
  padding: 40px 32px;
  background: #fff;
  border: 1px solid var(--bp-line);
  border-radius: 12px;
  text-align: center;
}
.home-empty p { margin: 0 0 24px; color: var(--bp-muted); }
.home-empty-btn { min-height: 48px; padding: 10px 28px; font-size: 17px; }

.bp-modal.home-dialog-narrow { width: min(480px, calc(100vw - 32px)); }
.home-dialog-body { padding-top: 16px; }
.home-dialog-body > .bp-form-error { margin: 0 0 8px; }
.home-dialog-intro { margin: 0 0 16px; }
.home-row-gap { margin-top: 12px; }
.home-hint-wide { flex-basis: 100%; }

/* ---- compare page (compare.html) ---- */

.page-main.cmp-main { max-width: 1600px; }
.cmp-top-actions { display: flex; gap: 8px; }
.cmp-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cmp-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--bp-line);
  border-radius: 10px;
}
.cmp-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--bp-line);
}
.cmp-pane-head h2 { margin: 0; font-size: 19px; }
.cmp-facts { margin: 0; color: var(--bp-muted); font-size: 13px; }
.cmp-frame { display: block; width: 100%; height: 520px; border: 0; background: var(--bp-soft); }

.cmp-equipment { margin-top: 32px; }
.cmp-summary { margin: -8px 0 12px; font-weight: 600; }
.cmp-summary.has-differences { color: var(--bp-warn); }
.cmp-num { text-align: right; }
.page .cmp-table th.cmp-num { text-align: right; }
.cmp-where { color: var(--bp-muted); }
.cmp-row.is-different td { background: var(--bp-warn-soft); font-weight: 600; }
.cmp-badge { background: var(--bp-warn); color: #fff; }

@media (max-width: 900px) {
  .cmp-panes { grid-template-columns: 1fr; }
}

/* ---- coming next (booths page) ---- */

.coming-next { padding-top: 0; }
.coming-next .page-section { margin-top: 0; }
.coming-next h2 { margin-bottom: 2px; }
.coming-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.coming-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  height: 100%;
  padding: 12px 14px;
  border: 1px dashed #c3cad4;
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--bp-muted);
  font: 14px/1.45 var(--bp-font);
  text-align: left;
  cursor: default;
}
.coming-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.coming-name { color: #6b7583; font-size: 15px; }
.coming-tag {
  flex: none;
  padding: 1px 7px;
  border-radius: 999px;
  background: #eceff3;
  color: #6b7583;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ---- products page ---- */

.prod-section { margin-top: 0; }
.prod-section .page-intro { margin: -8px 0 16px; }
.prod-error { display: block; margin-top: 4px; }
.prod-origin { color: var(--bp-muted); font-size: 13px; overflow-wrap: anywhere; }
.prod-type-row { align-items: center; }
.prod-type-row > .bp-field { flex: 1 1 280px; }
.prod-type-count { flex: 0 0 80px; color: var(--bp-muted); font-size: 14px; }
.prod-add { margin: 16px 0 0; }
.page .prod-add input { width: 280px; }

/* Past shows: the selects are wide enough to read their values. */
.page .prod-shows select { width: auto; min-width: 6rem; }
.page .prod-shows td:nth-child(4) select { min-width: 16rem; }

/* ---- signing in ---- */
.sign-main { display: flex; justify-content: center; padding-top: 64px; }
.sign-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 400px;
  padding: 32px;
  background: #fff;
  border: 1px solid var(--bp-line);
  border-radius: 10px;
}
.sign-card h1 { margin: 0; }
.sign-card .page-intro, .sign-card .bp-hint, .sign-card .bp-form-error { margin: 0; }
.sign-card input { width: 100%; box-sizing: border-box; }

/* Who is signed in, at the right of the header. */
.user-menu { display: flex; align-items: center; gap: 10px; margin-left: auto; font-size: 14px; white-space: nowrap; }
.user-menu-name { font-weight: 600; }
.user-menu-level { color: var(--bp-muted); }
.user-menu-btn {
  padding: 4px 10px;
  border: 1px solid var(--bp-line);
  border-radius: 6px;
  background: #fff;
  color: var(--bp-ink);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.user-menu-btn:hover { background: var(--bp-soft); }
.topbar .user-menu { margin-left: 12px; }

.home-everyone { margin: 0 0 16px; }
.home-owner { margin: 0; color: var(--bp-muted); font-size: 13px; }

/* What only a Manager or an Admin can do is not offered to a User. */
body[data-level="user"] .manager-only { display: none !important; }
body[data-level="user"] .manager-lock { pointer-events: none; background: var(--bp-soft); }

/* ---- the Trash, under the booths ---- */
.home-trash { margin-top: 40px; }
.home-trash summary { cursor: pointer; color: var(--bp-muted); font-weight: 600; }
.home-trash .page-intro { margin: 8px 0 12px; }
.home-trash-list { margin: 0; padding: 0; list-style: none; }
.home-trash-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid var(--bp-line);
  border-radius: 8px;
}

/* ---- sharing ---- */
.home-shared { margin-top: 36px; }
.home-sharing { font-size: 13px; }
.home-share-label { margin: 16px 0 6px; }
.home-share-people {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid var(--bp-line);
  border-radius: 8px;
}
