/* FPCEM staff surfaces: the dark phone door/childcare screens and the
   printable paper sheets. Ported from the Flask app's fpcem.css, but
   scoped under .fpcem-door-night and .fpcem-sheetpage wrappers so the
   plugin never restyles the host theme. Every color is a variable on the
   wrapper; the theme owns the rest of the page. */

.fpcem-door-night,
.fpcem-sheetpage {
  --bg: #f0f2f4;
  --card: #ffffff;
  --ink: #1f3b57;
  --ink-soft: #4d6b80;
  --navy: #1f3b57;
  --navy-deep: #142b41;
  --red: #a8322a;
  --red-deep: #862720;
  --apple: #c0392b;
  --ok: #2e7d4f;
  --line: #d9dfe4;
  --shadow: 0 10px 30px rgba(0, 40, 67, .12);
  --sans: "Montserrat", "Trebuchet MS", "Gill Sans", sans-serif;
  font-family: var(--sans);
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.5;
  box-sizing: border-box;
}
.fpcem-door-night *, .fpcem-door-night *::before, .fpcem-door-night *::after,
.fpcem-sheetpage *, .fpcem-sheetpage *::before, .fpcem-sheetpage *::after {
  box-sizing: border-box;
}
.fpcem-door-night [hidden], .fpcem-sheetpage [hidden] { display: none !important; }
.fpcem-door-night h1, .fpcem-door-night h3,
.fpcem-sheetpage h1, .fpcem-sheetpage h3 {
  font-weight: 700; margin: 0; letter-spacing: -.2px;
}

/* ------------------------------------------------------------- buttons */
.fpcem-door-night .btn, .fpcem-sheetpage .btn {
  display: inline-block; font: inherit; font-weight: 700; font-size: 15px;
  padding: 11px 22px; border-radius: 6px;
  border: 1.5px solid var(--red-deep); background: var(--red); color: #fff;
  cursor: pointer; text-decoration: none;
  transition: transform .06s ease, background .15s ease;
}
.fpcem-door-night .btn:hover, .fpcem-sheetpage .btn:hover { background: var(--red-deep); color: #fff; }
.fpcem-door-night .btn:active, .fpcem-sheetpage .btn:active { transform: translateY(1px); }
.fpcem-door-night .btn.ghost, .fpcem-sheetpage .btn.ghost { background: transparent; color: var(--red); }
.fpcem-door-night .btn.ghost:hover, .fpcem-sheetpage .btn.ghost:hover { background: rgba(154, 22, 35, .07); color: var(--red); }
.fpcem-door-night .btn.navy { background: var(--navy); border-color: var(--navy-deep); color: #fff; }
.fpcem-door-night .btn.navy:hover { background: var(--navy-deep); }
.fpcem-door-night .btn.small, .fpcem-sheetpage .btn.small { padding: 6px 12px; font-size: 13.5px; }
.fpcem-door-night .btn.ghost { border-color: #2a4c63; color: #9fc3e0; }
.fpcem-door-night .btn.ghost:hover { background: rgba(159, 195, 224, .1); color: #9fc3e0; }

.fpcem-door-night .fine, .fpcem-sheetpage .fine { color: var(--ink-soft); font-size: 12.5px; }

/* ----------------------------------------------------------- unbound */
/* A staff page that does not name its dinner. Deliberately loud: on a
   phone at the door this is the only thing standing between an usher and
   the wrong guest list. Amber, not red, because the page still works. */
.fpcem-unbound {
  margin: 0 0 16px; padding: 13px 16px;
  background: #fdf4e3; border: 1px solid #e0b95c; border-left-width: 5px;
  border-radius: 8px; color: #4a3708;
  font-size: 14.5px; line-height: 1.5;
}
.fpcem-unbound p { margin: 0 0 7px; }
.fpcem-unbound p:last-child { margin-bottom: 0; }
.fpcem-unbound code {
  display: inline-block; margin-top: 3px; padding: 2px 7px;
  background: #fff; border: 1px solid #e0b95c; border-radius: 4px;
  font-size: 13.5px; color: #3a2b06; word-break: break-all;
}
@media print { .fpcem-unbound { display: none; } }

/* --------------------------------------------------------------- gate */
.fpcem-gate {
  max-width: 560px; margin: 30px auto; padding: 24px 26px;
  background: #fff; border: 1px solid #d9dfe4; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 40, 67, .12); color: #1f3b57;
  font-size: 15.5px; line-height: 1.55; text-align: center;
}
.fpcem-gate p { margin: 0 0 14px; }
.fpcem-gate p:last-child { margin-bottom: 0; }
.fpcem-gate-btn {
  display: inline-block; font-weight: 700; font-size: 15px;
  padding: 11px 22px; border-radius: 6px;
  border: 1.5px solid #862720; background: #a8322a; color: #fff !important;
  text-decoration: none;
}
.fpcem-gate-btn:hover { background: #862720; }

/* --------------------------------------------------------- door (dark) */
.fpcem-door-night { background: #06131d; color: #e8eef3; border-radius: 12px; }
.fpcem-door-night a { color: #7f99ab; }
.fpcem-door-night .door-wrap { max-width: 760px; margin: 0 auto; padding: 14px 14px 80px; position: relative; }

/* The allergy bubble on the door screen. Same component as the seating
   board and the room map, dressed for the dark night screen: a pale card
   on a dark roster rather than the other way round. Anchored to
   .door-wrap so a bubble on the last row is not clipped by its row. */
.fpcem-door-night [data-note] { cursor: help; }
.fpcem-door-night [data-note]:focus-visible { outline: 2px solid #ffce6b; outline-offset: 3px; border-radius: 50%; }
.fpcem-door-night .fpcem-note-tip {
  position: absolute;
  z-index: 40;
  max-width: 260px;
  background: #f4f8fb;
  color: #10293a;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  padding: 9px 12px;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .55);
  pointer-events: none;
}
.fpcem-door-night .fpcem-note-tip b {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: #a8322a;
  margin-bottom: 2px;
}
.fpcem-door-night .fpcem-note-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: var(--tip-arrow, 50%);
  margin-left: -7px;
  border: 7px solid transparent;
  border-top-color: #f4f8fb;
}
.fpcem-door-night .fpcem-note-tip.below::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: #f4f8fb;
}
.fpcem-door-night .door-wrap-wide { max-width: 860px; }
.fpcem-door-night .door-head { display: flex; align-items: center; gap: 10px; margin: 4px 2px 12px; }
.fpcem-door-night .door-head h1 { font-size: 22px; color: #fff; flex: 1; }
.fpcem-door-night .door-head .pill { font-size: 12px; color: #7f99ab; font-weight: 600; }

.fpcem-door-night .counts { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 9px; margin-bottom: 14px; }
.fpcem-door-night .counts .c { background: #0c2333; border: 1px solid #1d3d52; border-radius: 10px; padding: 10px 12px; text-align: center; }
.fpcem-door-night .counts .c .n { font-size: 26px; font-weight: 800; color: #fff; }
.fpcem-door-night .counts .c.in .n { color: #7fd6a0; }
.fpcem-door-night .counts .c .l { font-size: 10.5px; color: #7f99ab; text-transform: uppercase; letter-spacing: .6px; font-weight: 700; }

.fpcem-door-night .door-search { position: sticky; top: 8px; z-index: 5; }
.fpcem-door-night .door-search input {
  width: 100%; padding: 15px 16px; font-size: 18px; border-radius: 11px;
  border: 1.5px solid #2a4c63; background: #0c2333; color: #fff; font-family: var(--sans);
}
.fpcem-door-night .door-search input::placeholder { color: #6d87a0; }
.fpcem-door-night .door-search input:focus { outline: 2px solid var(--red); }

.fpcem-door-night .door-list { list-style: none; margin: 14px 0 0; padding: 0; }
.fpcem-door-night .door-row {
  display: flex; align-items: center; gap: 12px;
  background: #0c2333; border: 1px solid #1d3d52; border-radius: 11px;
  padding: 13px 14px; margin-bottom: 9px;
}
.fpcem-door-night .door-row .d-main { flex: 1; min-width: 0; }
.fpcem-door-night .door-row .d-name { font-size: 18px; font-weight: 700; color: #fff; }
.fpcem-door-night .door-row .d-sub { font-size: 12.5px; color: #7f99ab; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-weight: 600; }
.fpcem-door-night .door-row .d-table {
  font-size: 20px; font-weight: 800; color: #ffce6b;
  min-width: 92px; text-align: center;
}
.fpcem-door-night .door-row .d-table.none { color: #6d87a0; font-size: 12px; font-weight: 600; }
.fpcem-door-night .door-row button.checkin {
  font: inherit; font-weight: 700; font-size: 14.5px;
  border-radius: 9px; padding: 12px 16px; min-width: 116px;
  border: 1.5px solid var(--red-deep); background: var(--red); color: #fff; cursor: pointer;
}
.fpcem-door-night .door-row button.checkin:active { transform: translateY(1px); }
.fpcem-door-night .door-row.in { border-color: #2e7d4f; background: #0d2a22; }
.fpcem-door-night .door-row.in button.checkin { background: transparent; border-color: #2e7d4f; color: #7fd6a0; }
.fpcem-door-night .door-row.in .d-name::after { content: " ✓"; color: #7fd6a0; }
@keyframes fpcem-pop { 0% { transform: scale(.96); } 60% { transform: scale(1.01); } 100% { transform: scale(1); } }
.fpcem-door-night .door-row.just-in { animation: fpcem-pop .25s ease; }
/* --------------------------------------------------- door on a phone
   The door row is [name] [table] [Check in], and the last two hold fixed
   widths, so on a narrow screen the name is squeezed into whatever is
   left: about 130px on a 375px phone, which wraps even a short name onto
   two lines. Ushers read this list one-handed with a queue in front of
   them, so below this width the row stacks instead: the name gets the
   full width, and the table and the button sit under it. */
@media (max-width: 430px) {
  .fpcem-door-night .door-row {
    flex-wrap: wrap;
    row-gap: 10px;
  }
  .fpcem-door-night .door-row .d-main {
    flex: 1 1 100%;
  }
  .fpcem-door-night .door-row .d-table {
    min-width: 0;
    text-align: left;
    flex: 1 1 auto;
  }
  .fpcem-door-night .door-row .checkin {
    flex: 0 0 auto;
    margin-left: auto;
  }
  /* The event name would otherwise share the heading's line and break
     "Door check-in" across it. */
  .fpcem-door-night .door-head {
    flex-wrap: wrap;
    row-gap: 2px;
  }
  .fpcem-door-night .door-head h1 {
    flex: 1 1 100%;
  }
}

.fpcem-door-night .door-empty { color: #6d87a0; text-align: center; padding: 26px 0; }
.fpcem-door-night .door-foot { display: flex; justify-content: center; gap: 10px; margin-top: 16px; }

/* ----------------------------------------------------------- dialogs */
.fpcem-door-night dialog {
  border: 1px solid #2a4c63; border-radius: 12px; box-shadow: var(--shadow);
  padding: 22px; background: #0c2333; color: #e8eef3; max-width: 380px; width: 92vw;
  font-family: var(--sans); font-size: 15.5px; line-height: 1.5;
}
.fpcem-door-night dialog::backdrop { background: rgba(0, 40, 67, .5); }
.fpcem-door-night dialog h3 { font-size: 19px; color: #fff; margin-bottom: 6px; }
.fpcem-door-night dialog .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.fpcem-door-night dialog .fine { color: #7f99ab; }
.fpcem-door-night label.f { display: block; margin: 15px 0 5px; font-weight: 700; font-size: 13.5px; }
.fpcem-door-night dialog input[type=text], .fpcem-door-night dialog input[type=email],
.fpcem-door-night dialog input[type=tel], .fpcem-door-night dialog input[type=number] {
  width: 100%; padding: 11px 12px; font: inherit;
  border: 1.5px solid #2a4c63; border-radius: 7px;
  background: #06131d; color: #fff;
}
.fpcem-door-night dialog input:focus { outline: 2px solid var(--red); outline-offset: 1px; border-color: var(--red); }
.fpcem-door-night .late-party { width: 100%; padding: 11px 12px; font: inherit; border-radius: 7px; }

@media (prefers-reduced-motion: reduce) {
  .fpcem-door-night * { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------ walk-up + childcare */
.fpcem-door-night .walkup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fpcem-door-night .small-checkin { font: inherit; font-weight: 700; font-size: 13px; border-radius: 8px; padding: 8px 13px;
  border: 1.5px solid var(--red-deep); background: var(--red); color: #fff; cursor: pointer; }
.fpcem-door-night .ghostbtn { font: inherit; font-weight: 700; font-size: 12.5px; border-radius: 8px; padding: 7px 12px;
  border: 1.5px solid #2a4c63; background: transparent; color: #9fc3e0; cursor: pointer; }
.fpcem-door-night .cc-family { flex-direction: column; align-items: stretch; }
.fpcem-door-night .cc-family .d-main { width: 100%; }
.fpcem-door-night .cc-kids { list-style: none; margin: 10px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.fpcem-door-night .cc-child { display: flex; align-items: center; gap: 10px; background: #0a1d2b; border: 1px solid #1d3d52;
  border-radius: 9px; padding: 9px 12px; }
.fpcem-door-night .cc-child.in { border-color: #2e7d4f; background: #0d2a22; }
.fpcem-door-night .cc-child.out { opacity: .55; }
.fpcem-door-night .cc-child .k-main { flex: 1; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; min-width: 0; }
.fpcem-door-night .cc-child .k-name { font-weight: 700; color: #fff; font-size: 15.5px; }
.fpcem-door-night .cc-child .k-age { font-size: 12.5px; color: #7f99ab; font-weight: 600; }
.fpcem-door-night .cc-child .k-allergy { font-size: 12.5px; color: #f0a9a0; font-weight: 700; }
.fpcem-door-night .cc-child .k-status { font-size: 12px; color: #7f99ab; }
.fpcem-door-night .k-phone { color: #ffce6b; font-weight: 800; text-decoration: none; font-size: 15px; }
.fpcem-door-night .cc-add { display: grid; grid-template-columns: 1.3fr .5fr 1.1fr auto; gap: 8px; margin: 6px 0 8px; }
.fpcem-door-night .cc-add input { padding: 10px 11px; font-size: 14px; border-radius: 9px; border: 1.5px solid #2a4c63;
  background: #0a1d2b; color: #fff; font-family: var(--sans); }
.fpcem-door-night .cc-add input::placeholder { color: #6d87a0; }
.fpcem-door-night .door-wrap .fine { color: #7f99ab; }

/* ------------------------------------------------- printable door list
   The paper fallback. On screen these read as stacked white sheets; on
   paper each one starts a new page, the brand colors drop to black ink so
   a cheap office printer stays legible, and table headers repeat when a
   list runs past one page. Nothing here is decorative: every rule exists
   because a sheet in a binder has to be readable at a dim registration
   desk by somebody who has never seen the screen version. */
.fpcem-sheetpage { background: var(--bg); color: var(--ink); padding: 1px 0 24px; border-radius: 12px; }
.fpcem-sheetpage .sheetbar {
  max-width: 940px; margin: 22px auto 0; padding: 0 18px;
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.fpcem-sheetpage .sheet {
  max-width: 940px; margin: 22px auto; padding: 30px 34px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); color: #111;
}
.fpcem-sheetpage .sheet-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 20px; border-bottom: 2px solid var(--navy); padding-bottom: 12px;
  margin-bottom: 16px;
}
.fpcem-sheetpage .sheet-head h1 { font-size: 24px; color: var(--navy); line-height: 1.15; }
.fpcem-sheetpage .sheet-sub { color: var(--ink-soft); font-size: 14px; margin: 3px 0 0; }
.fpcem-sheetpage .sheet-meta { text-align: right; font-size: 12px; color: var(--ink-soft);
  line-height: 1.5; white-space: nowrap; }
.fpcem-sheetpage .sheet-note {
  font-size: 12.5px; color: #333; margin: 0 0 14px;
  border-left: 3px solid var(--line); padding: 6px 0 6px 10px;
}
.fpcem-sheetpage .sheet-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fpcem-sheetpage .sheet-table th {
  text-align: left; font-size: 10.5px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-soft);
  border-bottom: 1px solid var(--navy); padding: 5px 8px 5px 0;
}
.fpcem-sheetpage .sheet-table td { padding: 6px 8px 6px 0; border-bottom: 1px solid #e6eaee;
  vertical-align: baseline; }
.fpcem-sheetpage .sheet-table .num { text-align: center; width: 58px; }
.fpcem-sheetpage .sheet-table .tick { width: 44px; }
.fpcem-sheetpage .sheet-table .flags { font-size: 11px; color: var(--apple);
  text-transform: uppercase; letter-spacing: .04em; }
.fpcem-sheetpage .sheet-table .box {
  display: inline-block; width: 15px; height: 15px;
  border: 1.5px solid #666; border-radius: 3px;
}
.fpcem-sheetpage .sheet-table .rule { display: inline-block; width: 100%; min-width: 52px;
  border-bottom: 1px solid #999; height: 13px; }
.fpcem-sheetpage .sheet-tables { display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.fpcem-sheetpage .sheet-tcard { border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; break-inside: avoid; }
.fpcem-sheetpage .sheet-tnum { font-weight: 800; color: var(--navy); font-size: 15px; }
.fpcem-sheetpage .sheet-thost { font-size: 12.5px; color: var(--red); font-weight: 700; }
.fpcem-sheetpage .sheet-tcard ol { margin: 7px 0 0 18px; padding: 0; font-size: 12.5px; line-height: 1.5; }
.fpcem-sheetpage .sheet-tcard .mark { color: var(--apple); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .04em; }

@media print {
  /* Colored ink is unreliable and expensive; paper goes black on white. */
  .fpcem-sheetpage { --navy: #000; --red: #000; --apple: #000; --ink-soft: #333;
    --line: #999; background: #fff; border-radius: 0; }

  /* The sheets live inside a theme page. Hide the theme's chrome so paper
     carries only the sheets: everything goes invisible, then the sheet
     wrapper (and all of it) comes back and takes the full page. */
  body.fpcem-has-doorlist *,
  body:has(.fpcem-sheetpage) * { visibility: hidden; }
  /* The show rules must outrank the hide rules above (their body-classed
     selectors carry higher specificity than a bare class), or the whole
     printout comes out blank. */
  .fpcem-sheetpage, .fpcem-sheetpage *,
  body.fpcem-has-doorlist .fpcem-sheetpage,
  body.fpcem-has-doorlist .fpcem-sheetpage *,
  body:has(.fpcem-sheetpage) .fpcem-sheetpage,
  body:has(.fpcem-sheetpage) .fpcem-sheetpage * { visibility: visible; }
  /* The hidden theme still occupies layout height; collapse it so the
     sheets are not followed by blank pages. */
  html, body { height: auto !important; min-height: 0 !important; }
  body.fpcem-has-doorlist .fpcem-sheetpage,
  body:has(.fpcem-sheetpage) .fpcem-sheetpage {
    position: absolute; left: 0; top: 0; width: 100%; margin: 0; padding: 0;
  }

  .fpcem-sheetpage .noprint, .fpcem-sheetpage .sheetbar { display: none !important; visibility: hidden !important; }
  .fpcem-sheetpage .sheet {
    max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0;
    box-shadow: none; break-after: page; page-break-after: always;
  }
  .fpcem-sheetpage .sheet:last-child { break-after: auto; page-break-after: auto; }
  .fpcem-sheetpage .sheet-head { break-after: avoid; }
  .fpcem-sheetpage .sheet-table thead { display: table-header-group; }   /* repeat per page */
  .fpcem-sheetpage .sheet-table tr { break-inside: avoid; page-break-inside: avoid; }
  .fpcem-sheetpage .sheet-table td { padding-top: 7px; padding-bottom: 7px; }
  @page { margin: 14mm; }
}

/* ------------------------------------------------------------- branding */
/* The organization's logo on every printed sheet header. Colors arrive as
   a variable override the doorlist prints inline; see FPCEM_Staff. */
.fpcem-sheetpage .sheet-logo {
  height: 48px; width: auto; max-width: 170px; object-fit: contain;
  align-self: center; flex: 0 0 auto;
}
@media print {
  .fpcem-sheetpage .sheet-logo {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .fpcem-sheetpage .sheet-head h1, .fpcem-sheetpage .sheet-head h3 {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
}
