/* Elite Lighting Australia intranet — brand styling
   Primary blue: #0800F0  |  Neutrals: #FFFFFF / #000000 with tints
   Font: Inter (sans-serif), system-font fallback stack.

   NOTE (2026-08-02): the ORIGINAL brand guidelines specified Space Mono
   (monospace) as the intranet's typeface, and that's what this app
   shipped with initially. This was deliberately changed to a sans-serif
   at Brock's request for readability - see README.md "Typography" for
   the full note. Not an oversight; if the brand guidelines are ever
   revisited, that's the place to reconcile this.
*/

:root {
  --elite-blue: #0800F0;
  --elite-blue-dark: #06009e;
  --black: #000000;
  --white: #FFFFFF;
  --black-25: rgba(0, 0, 0, 0.25);
  --black-10: rgba(0, 0, 0, 0.08);
  --black-05: rgba(0, 0, 0, 0.04);
  --grey-border: #e2e2e6;
  --warn-bg: #fff4e5;
  --warn-border: #f0b429;
  --ok-bg: #e8f9ee;
  --ok-border: #1fa855;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--white);
  color: var(--black);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  /* Defensive safety net: real data (long filenames, long emails, long
     event names) can be longer than anything tested here. This lets any
     single unbreakable string wrap/break inside its container as a last
     resort rather than force horizontal scrolling on the whole page,
     without changing normal word-wrapping behavior for regular text. */
  overflow-wrap: anywhere;
}
html { overflow-x: hidden; }

h1, h2, h3 {
  font-weight: 700;
  letter-spacing: -0.01em;
}

a {
  color: var(--elite-blue);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
  background: var(--white);
  border-bottom: 3px solid var(--elite-blue);
}
.site-header__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-header__brand { display: inline-flex; padding: 8px; }
.site-header__logo { width: 160px; height: auto; display: block; }
/*
  BUG FIX (2026-08-02): as more nav links were added over time (Damaged
  Equipment, Announcements, Settings, etc.) the desktop nav's total
  content width grew past what fits in the header, and with no
  flex-wrap/white-space protection, flexbox's default behavior shrank
  each <a> down to a near-zero width. Combined with the global
  `overflow-wrap: anywhere` safety net (near the top of this file, added
  so long filenames/emails elsewhere never force horizontal scrolling),
  that meant text inside each squeezed nav link broke mid-word into a
  tall single-character-wide column - e.g. "Documents" rendering as
  "Doc/ume/nts" stacked vertically. `white-space: nowrap` + `flex-shrink:
  0` (below, on the link/account items) guarantees a link's own text is
  never itself wrapped or shrunk.

  FOLLOW-UP (2026-08-02): the nav is now split into two groups in the
  markup - .site-header__links (the page links, left-aligned, wraps to
  as many rows as it needs) and .site-header__account (the signed-in
  user's name + Sign out, pinned to the far right, top-aligned, never
  part of the wrapping link flow). Previously the account info was just
  another item interleaved among the links, so it could land stranded
  mid-row once the links wrapped - this keeps it visually and
  structurally separate, like a typical app header's left-nav/
  right-account layout.
*/
.site-header__nav {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 20px;
  flex: 1;
  min-width: 0;
}
.site-header__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  flex: 1;
  min-width: 0;
}
.site-header__account {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  padding-top: 8px;
}
.site-header__links a,
.site-header__account a,
.site-header__account .site-header__user {
  white-space: nowrap;
  flex-shrink: 0;
  /*
    SECOND BUG FIX (2026-08-02): white-space: nowrap alone was NOT enough
    to keep each nav item's text on one line - the global
    `overflow-wrap: anywhere` set on html/body (top of this file, for
    long filenames/emails elsewhere) is specifically designed to create a
    break opportunity EVEN when white-space says nowrap, whenever the
    browser decides a box is too narrow for its content. That's what was
    still causing "Upload Document" / "Pending Approvals" etc. to wrap
    onto two lines inside their own link, even after nowrap was added.
    Explicitly resetting overflow-wrap (and word-break, for the same
    class of bug) back to normal for nav items defeats that global rule
    here, so nowrap actually behaves like plain single-line nowrap.
  */
  overflow-wrap: normal;
  word-break: normal;
}
/* Small count badge on the "Damaged Equipment" nav link - shows the
   number of currently active/unresolved reports (see
   activeDamagedEquipmentCount in server.js, computed live off
   services/damagedEquipmentService.js on every request). Purely a
   visibility aid alongside the existing email alert, not a replacement
   for it - reuses the same red/warn-ish treatment as other small status
   indicators in this file, but its own class since it needs to sit
   inline with link text rather than as a block-level notice. */
.nav-badge {
  display: inline-block;
  min-width: 18px;
  padding: 1px 6px;
  margin-left: 6px;
  border-radius: 10px;
  background: var(--elite-blue);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  vertical-align: middle;
  /* Same overflow-wrap: anywhere bug class as .button/.file-table th -
     a badge is always a short count, never worth wrapping. */
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}
/* Small unlabelled dot variant of .nav-badge, used on the "More" summary
   below when something INSIDE the collapsed group needs attention (a
   pending approval, an active damaged-equipment report) - keeps that
   signal visible without spelling out a full link list on the always-
   visible bar. */
.nav-badge--dot {
  min-width: 0;
  width: 8px;
  height: 8px;
  padding: 0;
  margin-left: 4px;
  vertical-align: text-top;
}
.site-header__links a,
.site-header__account a {
  color: var(--black);
  font-weight: 700;
  padding: 8px 4px;
  border-bottom: 2px solid transparent;
}

/*
  "More" nav dropdown (added 2026-08-06, tidy-up - see the big comment in
  partials/header.ejs for why the nav was split into primary links +
  this group). Built on a native <details>/<summary> element rather than
  a custom JS dropdown component: no extra markup/ARIA wiring needed for
  basic keyboard/screen-reader support (browsers handle expand/collapse
  and focus semantics for <details> natively), and it degrades to a
  plain in-flow expanding section if CSS/JS ever fails to load, rather
  than becoming inert. public/js/nav-toggle.js adds only the two bits of
  behavior a real dropdown needs that <details> doesn't give for free:
  closing on an inside link click, and closing on an outside click.
*/
.nav-more { position: relative; }
.nav-more > summary {
  list-style: none;
  cursor: pointer;
  color: var(--black);
  font-weight: 700;
  padding: 8px 4px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  display: flex;
  align-items: center;
}
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.nav-more[open] > summary::after { transform: rotate(-135deg); }
.nav-more > summary:hover,
.nav-more[open] > summary {
  color: var(--elite-blue);
  border-bottom-color: var(--elite-blue);
}
.nav-more__panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  background: var(--white);
  border: 1px solid var(--grey-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 6px;
}
.nav-more__panel a {
  padding: 10px 12px !important;
  border-bottom: none !important;
  border-radius: 6px;
}
.nav-more__panel a:hover,
.nav-more__panel a.is-active {
  background: var(--black-05);
  color: var(--elite-blue);
}
.site-header__links a:hover,
.site-header__links a.is-active,
.site-header__account a:hover {
  color: var(--elite-blue);
  border-bottom-color: var(--elite-blue);
  text-decoration: none;
}

/* Hamburger toggle - hidden on desktop (the nav is a plain inline row),
   shown only below the mobile breakpoint where it opens/closes the same
   nav as a dropdown. See public/js/nav-toggle.js. */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle__bar { display: block; width: 100%; height: 2px; background: var(--black); }

@media (max-width: 900px) {
  .site-header__inner { flex-wrap: wrap; }
  .nav-toggle { display: flex; }
  .site-header__nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    width: 100%;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--grey-border);
  }
  .site-header__nav.is-open { display: flex; }
  /* On mobile the two groups stack full-width in the dropdown, same as
     before the desktop split - links first, account info below as its
     own visually separated block (border-top + margin), rather than
     pinned to the right (there's no "right" to pin to in a single
     narrow column). */
  .site-header__links {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }
  .site-header__account {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding-top: 12px;
    margin-top: 10px;
    border-top: 1px solid var(--grey-border);
  }
  .site-header__links a,
  .site-header__account a {
    padding: 12px 8px;
    border-bottom: 1px solid var(--black-05);
  }
  .site-header__links a.is-active { border-bottom-color: var(--elite-blue); }
  .site-header__user { padding: 0 8px; }

  /*
    BUG FIX (2026-08-02): the mobile dropdown was designed to be a
    full-width in-flow panel below the header (.site-header__nav gets
    width:100% above) - that part was already correct. The actual bug:
    the desktop nav-wrapping fix further up this file sets `white-space:
    nowrap` + `flex-shrink: 0` on every nav link GLOBALLY (not scoped to
    desktop), with no min-width override. Flex items default to
    `min-width: auto`, meaning their CONTENT's intrinsic size still sets
    a hard minimum even when `align-items: stretch` is also stretching
    them - so a nowrap link whose text is wider than the (narrow, mobile)
    column was forcing that link wider than its container and overflowing
    to the right, past the viewport edge, which is what Brock saw ("pushed
    off to the right"). `overflow-x: hidden` on <html> then clipped it
    rather than showing a scrollbar, so it just looked cut off/misplaced
    instead of visibly overflowing.

    Fix: below the mobile breakpoint, let nav link text wrap normally
    again and reset min-width so nothing can force a link wider than the
    full-width column it's supposed to sit in - the desktop-only
    single-line requirement doesn't apply once every link is already on
    its own full-width row.
  */
  .site-header__links a,
  .site-header__account a,
  .site-header__account .site-header__user {
    white-space: normal;
    min-width: 0;
    flex-shrink: 1;
  }

  /* "More" dropdown on mobile: the floating absolutely-positioned panel
     that makes sense on desktop doesn't fit a narrow single-column
     layout, so below the breakpoint it instead just expands IN PLACE as
     part of the same stacked list every other nav link is already in -
     consistent with how the rest of the mobile nav behaves, and avoids a
     floating box escaping the viewport width on a small screen. */
  .nav-more > summary {
    padding: 12px 8px;
    border-bottom: 1px solid var(--black-05);
  }
  .nav-more[open] > summary { border-bottom-color: var(--elite-blue); }
  .nav-more__panel {
    position: static;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0 0 0 16px;
    min-width: 0;
  }
  .nav-more__panel a {
    padding: 12px 8px !important;
    border-bottom: 1px solid var(--black-05) !important;
  }
}

.drive-banner {
  background: var(--warn-bg);
  border-bottom: 1px solid var(--warn-border);
  color: #6b4a00;
  text-align: center;
  padding: 10px 16px;
  font-size: 0.9rem;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--elite-blue);
  color: var(--white);
  margin-top: 64px;
}
.site-footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.site-footer__logo { width: 100px; height: auto; }
.site-footer p { margin: 0; font-size: 0.85rem; opacity: 0.9; }

/* ---------- Layout ---------- */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 24px;
}
.section { margin-top: 48px; }
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 48px;
}
@media (max-width: 800px) {
  .two-col { grid-template-columns: 1fr; }
}
.panel {
  margin-top: 0;
  background: var(--black-05);
  border: 1px solid var(--grey-border);
  border-radius: 8px;
  padding: 24px;
}
.breadcrumb {
  font-size: 0.85rem;
  color: var(--black-25);
  margin-bottom: 8px;
}
.page-subtitle { color: #444; margin-top: -8px; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 32px 0 8px; }
.hero h1 { font-size: 2rem; margin-bottom: 8px; }
.hero p { color: #444; }
.hero__search {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.hero__search input {
  width: 100%;
  max-width: 420px;
}

/* ---------- Shows in Prep (Current RMS) ---------- */
.shows-in-prep { margin-top: 8px; }
.shows-in-prep__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.shows-in-prep__card {
  display: block;
  border: 1px solid var(--grey-border);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--white);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.shows-in-prep__card:hover {
  border-color: var(--elite-blue);
  box-shadow: 0 2px 8px rgba(8, 0, 240, 0.12);
}
.shows-in-prep__delivery {
  margin-top: 6px;
  font-size: 0.78rem;
  color: #666;
}
.shows-in-prep__name {
  font-weight: 700;
  margin-bottom: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Bar removed 2026-08-03 per Brock's request - just the plain percentage
   number now (was .shows-in-prep__bar / .shows-in-prep__bar-fill, no
   longer referenced by views/index.ejs). */
.shows-in-prep__percent {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--elite-blue);
}
/* Added 2026-08-16 (Brock's request) - "We Deliver" / "Client Collect"
   badge, sourced from Current RMS's own customer_collecting boolean field
   on the opportunity (see services/currentRmsService.js). */
.shows-in-prep__logistics {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.shows-in-prep__logistics--deliver {
  background: rgba(8, 0, 240, 0.1);
  color: var(--elite-blue);
}
.shows-in-prep__logistics--collect {
  background: rgba(0, 0, 0, 0.06);
  color: #555;
}

/* "Shows we have made happen in <year>" widget - same rationale/shape as
   Shows in Prep above, just a single number rather than a card grid.
   Sized as a standalone big number (2026-08-06, Brock's request - the
   heading now says the "in <year>" part, so the number underneath
   doesn't need to repeat it in a sentence) rather than inline text. */
.shows-completed { margin-top: 8px; }
.shows-completed__count {
  font-size: 3rem;
  font-weight: 700;
  color: var(--elite-blue);
  line-height: 1;
  margin-top: 12px;
}

/* ---------- Tiles ---------- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.tile {
  position: relative;
  display: block;
  border: 1px solid var(--grey-border);
  border-radius: 8px;
  padding: 20px 18px 18px;
  background: var(--white);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  overflow: hidden;
}
.tile[hidden], .tile--hidden { display: none !important; }
.tile:hover {
  text-decoration: none;
  box-shadow: 0 6px 18px var(--black-10);
  transform: translateY(-2px);
}
.tile__accent {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 4px;
  background: var(--elite-blue);
}
.tile__name {
  display: block;
  font-weight: 700;
  color: var(--black);
  margin-top: 6px;
}
.tile__desc {
  display: block;
  font-size: 0.82rem;
  color: #555;
  margin-top: 6px;
}

/* ---------- Record tile grid (Brock's request, 2026-09-04, widened to
   5-up 2026-09-07) - a grid of clickable cards (photo + name + a bit of
   quick info) used by both Consumables and Spare Parts. Narrows on
   smaller screens, same breakpoints used elsewhere in this file.
   grid-auto-rows: 1fr plus height: 100% on the card makes every tile
   in a row the same height regardless of how much each one's content
   fills out. */
.record-grid {
  display: grid;
  /* minmax(0, 1fr), not plain 1fr - a plain 1fr track still won't
     shrink below its content's min-content width, which is how
     Consumables' count-form once overflowed its tile; minmax(0, 1fr)
     lets the column (and everything sized to 100% inside it) actually
     shrink to fit 5 across. */
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 900px) {
  .record-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .record-grid { grid-template-columns: minmax(0, 1fr); }
}
.record-card {
  height: 100%;
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--grey-border);
  border-radius: 8px;
  padding: 14px;
  background: var(--white);
}
.record-card__photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  background: var(--black-05);
}
.record-card__photo--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.record-card__name {
  font-weight: 700;
  color: var(--black);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.record-card__name:hover { text-decoration: underline; }
.record-card__meta { font-size: 0.9rem; }
.consumable-card__qty { font-size: 0.9rem; }
/* Stacked, not side-by-side (Brock's request, 2026-09-07) - at 5
   tiles across, "Update count" next to a number input squeezed the
   input down to a near-unusable width; stacking means neither has to
   shrink to fit the other regardless of how narrow the tile gets. */
.record-card__qty-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}
.record-card__qty-form input {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--grey-border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  box-sizing: border-box;
}
.record-card__qty-form button { width: 100%; }

/* ---------- Birthdays ---------- */
.birthday-banner {
  background: var(--elite-blue);
  color: var(--white);
  font-weight: 700;
  font-size: 1.1rem;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 16px 0;
  text-align: center;
}
.birthday-list { list-style: none; margin: 16px 0 0; padding: 0; }
.birthday-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--grey-border);
}
.birthday-list__item:last-child { border-bottom: none; }
.birthday-list__item.is-today {
  font-weight: 700;
  color: var(--elite-blue);
}
.birthday-list__date { font-size: 0.85rem; color: #666; }
.birthday-list__item.is-today .birthday-list__date { color: var(--elite-blue); }

/* ---------- Announcements ---------- */
.announcement-list { list-style: none; margin: 16px 0 0; padding: 0; }
.announcement { padding: 14px 0; border-bottom: 1px solid var(--grey-border); }
.announcement:last-child { border-bottom: none; }
.announcement__meta { font-size: 0.75rem; color: var(--black-25); }
.announcement__title { font-weight: 700; margin-top: 2px; }
.announcement__body { margin: 6px 0 0; font-size: 0.9rem; color: #333; white-space: pre-wrap; }
.announcement__actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Files ---------- */
.file-list { list-style: none; margin: 16px 0 0; padding: 0; }
.file-list__item { padding: 10px 0; border-bottom: 1px solid var(--grey-border); }
.file-list__item:last-child { border-bottom: none; }
.file-list__meta { font-size: 0.78rem; color: #666; margin-top: 2px; }

.file-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 0.9rem;
}
.file-table th, .file-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--grey-border);
}
/* Column headers are always short, deliberate labels (e.g. "Supplier")
   - same overflow-wrap: anywhere bug class as .button above, so nowrap
   is safe here too. Deliberately NOT applied to .file-table td - a
   value cell (filenames, emails, etc.) can genuinely be long and still
   needs to wrap rather than force horizontal scroll. */
.file-table th { color: var(--black-25); font-weight: 700; font-size: 0.75rem; text-transform: uppercase; white-space: nowrap; overflow-wrap: normal; word-break: normal; }
/* Short field-name labels rendered as a literal table cell (e.g. Project
   Details on views/project-detail.ejs - "Description", "Started by") -
   same bug class as the nav links above ("BUG FIX (2026-08-02)"): the
   global `overflow-wrap: anywhere` safety net can split even a short
   single word mid-letter once its cell is squeezed narrow enough. These
   labels are always short, so nowrap is safe here (unlike a value cell,
   which may hold a genuinely long string that still needs to wrap). */
.file-table__label { white-space: nowrap; overflow-wrap: normal; word-break: normal; }
.file-table__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* Below the mobile breakpoint, .file-table and .version-history-table
   (see "Version history / badges" further down) stack into one card per
   row instead of scrolling or squeezing columns horizontally - each cell
   becomes its own line with its column header shown as a small label via
   the data-label attribute set on every <td> in partials/file-table.ejs,
   views/search.ejs, and views/document-history.ejs. */
@media (max-width: 640px) {
  .file-table, .version-history-table { border: none; }
  .file-table thead, .version-history-table thead { display: none; }
  .file-table tbody, .version-history-table tbody { display: block; }
  .file-table tr, .version-history-table tr {
    display: block;
    border: 1px solid var(--grey-border);
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 4px 12px;
  }
  .file-table td, .version-history-table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    text-align: right;
    border-bottom: 1px solid var(--black-05);
  }
  .file-table td:last-child, .version-history-table td:last-child { border-bottom: none; }
  .file-table td::before, .version-history-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--black-25);
    font-size: 0.72rem;
    text-transform: uppercase;
    text-align: left;
    flex-shrink: 0;
    padding-top: 2px;
    /* Same overflow-wrap: anywhere bug class as .button/.file-table th
       above (Brock's report, 2026-09-03 - "the word supplier... the r
       is on a second line") - this is the mobile stacked-card label,
       always a short column name, so nowrap is safe here too. */
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
  }
  /* Cells with no label (the trailing action-link column) don't need the
     space-between split - let the link sit flush right on its own line. */
  .file-table td[data-label=""] { justify-content: flex-end; }
  .file-table td[data-label=""]::before { content: none; }
}

.empty-state {
  color: #666;
  background: var(--black-05);
  border: 1px dashed var(--grey-border);
  border-radius: 8px;
  padding: 20px;
  margin-top: 16px;
}

/* ---------- Equipment Availability: "View bookings" expand row ---------- */
/* The bookings row is a normal <tr> (see views/equipment-availability.ejs)
   so it stacks correctly in the .file-table's mobile-responsive layout
   above, but its single colspan cell needs to escape the label/flex
   treatment applied to normal .file-table cells - a job list reads
   better as a plain block than squeezed into a flex row with an empty
   label. */
.bookings-row td { display: block !important; padding: 4px 12px 14px !important; }
.bookings-row__content:empty::before { content: "Loading…"; color: #666; font-size: 0.85rem; }
.bookings-row__content .booking-job {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--grey-border);
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 0.85rem;
}
.bookings-row__content .booking-job__dates { color: #666; }
.bookings-row__content .booking-job__qty { font-weight: 700; white-space: nowrap; }

/* ---------- Venue Codes: grouped-by-venue headings ---------- */
/* Each venue acts as a "parent folder" heading grouping its own codes -
   see services/venueCodesService.js#getGroupedByVenue - implemented as a
   simple heading + table per group rather than a real nested structure,
   since these are plain records rather than files/folders. */
.venue-codes-group { margin-top: 28px; }
.venue-codes-group:first-child { margin-top: 16px; }
.venue-codes-group__heading {
  margin: 0;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--elite-blue);
  font-size: 1.05rem;
}
.venue-codes-group__updated { color: #666; font-size: 0.75rem; }

/* ---------- Notices ---------- */
.notice {
  border-radius: 6px;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 0.9rem;
}
.notice--warn { background: var(--warn-bg); border: 1px solid var(--warn-border); color: #6b4a00; }
.notice--ok { background: var(--ok-bg); border: 1px solid var(--ok-border); color: #145a32; }

/* ---------- Hire Enquiries dashboard alert ---------- */
/* Persistent (no dismiss button - it should only ever go away because the
   underlying enquiries got handled, not because someone closed it) banner
   at the top of the homepage, shown only to staff whose role can see the
   Hire Enquiries pipeline (canViewEnquiries) AND only while there's at
   least one open (unclaimed or claimed-but-not-handled) enquiry - see
   views/index.ejs. Deliberately bolder/more urgent-looking than the
   quieter .notice styles used elsewhere, since a hire enquiry sitting
   unattended has a real business cost (a lost booking). */
.enquiries-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: #fff4e5;
  border: 2px solid #f0b429;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 20px 0;
}
.enquiries-alert__text {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: #6b4a00;
  font-size: 1rem;
}
.enquiries-alert__icon { font-size: 1.3rem; }
.enquiries-alert__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 12px;
  background: #f0b429;
  color: #3d2c00;
  font-size: 0.85rem;
}

/* ---------- Forms & buttons ---------- */
input[type="search"],
input[type="text"],
input[type="email"],
input[type="date"],
select,
textarea {
  font-family: inherit;
  padding: 10px 12px;
  border: 1px solid var(--grey-border);
  border-radius: 6px;
  font-size: 0.95rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
textarea { resize: vertical; }
.search-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.search-form input[type="search"] { flex: 1; min-width: 220px; }

.button {
  display: inline-block;
  background: var(--elite-blue);
  color: var(--white);
  border: none;
  border-radius: 6px;
  padding: 12px 20px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  /* Same bug class as the nav links' "BUG FIX (2026-08-02)" and the
     project Details table's .file-table__label - the global
     overflow-wrap: anywhere safety net (top of this file) can split
     even a short button label mid-word once its box is squeezed
     narrow enough (e.g. "Update" rendering as "Updat/e"). Button text
     is always short and deliberate, so nowrap is safe here. */
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}
.button:hover { background: var(--elite-blue-dark); text-decoration: none; }
.button--secondary {
  background: var(--white);
  color: var(--elite-blue);
  border: 1px solid var(--elite-blue);
}
.button--secondary:hover { background: var(--black-05); }
.button--sm { padding: 6px 12px; font-size: 0.8rem; border-radius: 5px; }

/* Native file inputs render at an unpredictable, often quite wide,
   browser-default size that isn't controllable via width alone - left
   unstyled they overflow any flex row or table cell placed alongside a
   button (Damaged Equipment/Staff Inductions/Projects upload-replace
   rows, etc). `flex` only takes effect when the parent is actually
   display:flex, so this is harmless everywhere else this input type is
   used. Site-wide fix, not a per-feature one. */
input[type="file"] {
  font-family: inherit;
  font-size: 0.85rem;
  max-width: 100%;
  min-width: 0;
  flex: 1 1 160px;
}

/* ---------- Dropzone ---------- */
.dropzone {
  margin-top: 16px;
  border: 2px dashed var(--grey-border);
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone.is-dragover {
  border-color: var(--elite-blue);
  background: var(--black-05);
}
.dropzone p { margin: 0 0 12px; color: #555; }
.dropzone__filename { margin-top: 12px; font-weight: 700; color: var(--elite-blue); }

form#upload-form { margin-top: 8px; }
form#upload-form > .button { margin-top: 16px; }

/* ---------- Event Photo Uploader ---------- */
form#event-upload-form { margin-top: 8px; max-width: 560px; }
form#event-upload-form > .button { margin-top: 16px; }
.form-row { position: relative; margin-bottom: 18px; }
/* overflow-wrap/word-break (not white-space: nowrap - some labels here
   are genuinely multi-word phrases that should still wrap normally at
   word boundaries) stop the global overflow-wrap: anywhere rule from
   splitting a short single-word label mid-character in a narrow column. */
.form-row label { display: block; font-weight: 700; margin-bottom: 6px; overflow-wrap: normal; word-break: normal; }
.form-row input[type="text"],
.form-row input[type="date"],
.form-row input[type="tel"],
.form-row input[type="email"],
.form-row input[type="url"],
.form-row input[type="datetime-local"],
.form-row input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--grey-border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  box-sizing: border-box;
}
.form-row input:focus { outline: 2px solid var(--elite-blue); outline-offset: 1px; }
.form-row__hint { margin: 6px 0 0; font-size: 0.85rem; color: #666; }
.file-table__meta { margin-top: 4px; font-size: 0.8rem; color: #666; }
.form-row--split { display: flex; gap: 16px; }
.form-row--split > div { flex: 1; min-width: 0; }
.form-row--split3 { display: flex; gap: 16px; }
.form-row--split3 > div { flex: 1; min-width: 0; }
.form-row--split3 > div input { width: 100%; box-sizing: border-box; }
@media (max-width: 560px) {
  .form-row--split { flex-direction: column; gap: 0; }
  .form-row--split3 { flex-direction: column; gap: 0; }
}
.form-subsection {
  border-left: 3px solid var(--elite-blue);
  padding: 4px 0 4px 16px;
  margin-bottom: 18px;
}
.form-subsection__hint { margin: 0 0 12px; font-weight: 700; font-size: 0.9rem; }

/* ---------- SWMS Builder checklist ---------- */
.swms-item-bank__heading { margin: 28px 0 4px; }
.swms-item-bank { margin-top: 16px; }
.swms-category {
  border: 1px solid var(--black-10);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.swms-category__heading { margin: 0 0 12px; color: var(--elite-blue); }
.swms-item { padding: 10px 0; border-top: 1px solid var(--black-05); }
.swms-item:first-child { border-top: none; padding-top: 0; }
.swms-item__checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 700;
  cursor: pointer;
}
.swms-item__checkbox { margin-top: 3px; }
.swms-item__standards { margin: 4px 0 0 26px; font-size: 0.85rem; color: #666; }
.swms-item__fields { margin: 12px 0 0 26px; }
.swms-item__fields .form-row { margin-bottom: 12px; }

.swms-item__risk-row {
  align-items: flex-end;
  gap: 16px;
}
.swms-item__risk-badge-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 100px;
}
.swms-risk-badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.85rem;
  text-align: center;
  background: #999999;
  color: #ffffff;
}

.swms-submit-row { margin-top: 24px; }

/* ---------- SWMS Builder signature capture ---------- */
.swms-signee-row {
  border: 1px solid var(--black-10);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.swms-signature-pad {
  display: block;
  width: 100%;
  max-width: 500px;
  height: 150px;
  border: 1px dashed var(--black-30, #999);
  border-radius: 4px;
  background: #ffffff;
  touch-action: none;
  cursor: crosshair;
}
.swms-signee-row__actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
#swms-add-signee { margin-top: 4px; }

.event-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  background: #fff;
  border: 1px solid var(--grey-border);
  border-radius: 6px;
  margin-top: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  overflow: hidden;
}
.event-suggestions__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}
.event-suggestions__item:hover,
.event-suggestions__item:focus { background: var(--black-05); }

/* MSDS "looks like an existing entry" confirmation prompt - reuses
   .event-suggestions/.event-suggestions__item for the box/buttons (see
   above), these just style the extra confirmation text. */
.msds-suggestion__prompt {
  margin: 0;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--black-05);
}
.msds-suggestion__confirmed {
  margin: 0;
  padding: 10px 12px;
  font-size: 0.9rem;
}

.form-row__radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 20px;
  font-weight: 400;
  cursor: pointer;
}

.file-preview-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  max-height: 140px;
  overflow-y: auto;
  text-align: left;
  font-size: 0.85rem;
  color: #555;
}
.file-preview-list li { padding: 2px 0; }

/* ---------- Event Drawings & Documents: grouped-by-event browser ---------- */
.event-year-group { margin-bottom: 28px; }
.event-year-group__heading {
  font-size: 1.05rem;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--grey-border);
}
.event-year-group__badge {
  display: inline-block;
  background: var(--elite-blue);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 999px;
  vertical-align: middle;
}
.event-group {
  border: 1px solid var(--grey-border);
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
}
.event-group__summary {
  cursor: pointer;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  background: var(--black-05);
  list-style: none;
}
.event-group__summary::-webkit-details-marker { display: none; }
.event-group__summary::before {
  content: "▸";
  margin-right: 6px;
  color: var(--elite-blue);
}
details[open] > .event-group__summary::before { content: "▾"; }
.event-group__name { font-weight: 700; }
.event-group__meta { font-size: 0.85rem; color: #666; }
.event-group__body { padding: 4px 16px 12px; }

/* Archived events (auto-computed, >7 days past final event date - see
   isEventArchived() in routes/category.js) collapse into their own
   nested <details> per year group, separate from the active list above,
   so the primary view doesn't get cluttered with old jobs. Still fully
   searchable - this is purely a display grouping. */
.event-archive-section {
  margin-top: 14px;
  border-top: 1px dashed var(--grey-border);
  padding-top: 10px;
}
.event-archive-section__summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  color: #666;
  list-style: none;
}
.event-archive-section__summary::-webkit-details-marker { display: none; }
.event-archive-section__summary::before {
  content: "▸";
  margin-right: 6px;
  color: var(--elite-blue);
}
details[open] > .event-archive-section__summary::before { content: "▾"; }
.event-archive-section__body { margin-top: 10px; }
.doctype-group { margin-top: 14px; }
.doctype-group:first-child { margin-top: 10px; }
.doctype-group__heading {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--elite-blue);
  margin: 0 0 6px;
}
.doctype-group__count {
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: #888;
  font-size: 0.8rem;
}
.doctype-group .file-table { border: 1px solid var(--grey-border); border-radius: 6px; overflow: hidden; }

/* ---------- Settings: per-user category access ---------- */
.settings-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px 16px;
  margin-top: 8px;
}
.settings-category-grid__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 400;
}

/* ---------- Event Photos browse/search ---------- */
.event-browse-result {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--grey-border);
}
.event-browse-result__title { margin: 0 0 4px; font-size: 1.15rem; }
.event-browse-result__meta { margin: 0 0 4px; font-size: 0.85rem; color: #666; }
.event-browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.event-browse-grid__item {
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  background: var(--black-05);
  border: 1px solid var(--grey-border);
}
.event-browse-grid__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.event-browse-grid__item-wrap { position: relative; }
.event-browse-grid__delete-form {
  position: absolute;
  top: 4px;
  right: 4px;
  margin: 0;
}
.event-browse-grid__delete {
  width: 22px;
  height: 22px;
  line-height: 20px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  font-size: 1rem;
  cursor: pointer;
}
.event-browse-grid__delete:hover { background: #c62828; }
.event-browse-grid__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 2rem;
}

/* Compact-by-default preview: only the first 4 photos/videos in an event
   show up front (see events-browse.ejs), with the rest behind this
   expander - same native <details>/<summary> toggle convention as
   .event-archive-section above, just styled as an inline text link
   rather than a full collapsible block header. */
.event-browse-more {
  margin-top: 6px;
}
.event-browse-more__summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--elite-blue);
  list-style: none;
}
.event-browse-more__summary::-webkit-details-marker { display: none; }
.event-browse-more__summary::before {
  content: "▸";
  margin-right: 6px;
}
details[open] > .event-browse-more__summary::before { content: "▾"; }
.event-browse-grid--expanded { margin-top: 10px; }

/* ---------- Unified search (/search) - grouped result sections ---------- */
/* One <section> per result type (Documents / Event Photos & Videos /
   Event Drawings & Documents / Venue Codes) so a single query's results
   never read as one confusing flat list - see routes/search.js and
   views/search.ejs. */
.search-section {
  margin-top: 28px;
}
.search-section:first-of-type {
  margin-top: 20px;
}
.search-section__heading {
  font-size: 1.1rem;
  margin: 0 0 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.search-section__count {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--white);
  background: var(--elite-blue);
  border-radius: 999px;
  padding: 1px 9px;
}
/* Card-style results (Event Photos, Event Drawings) - these aren't a
   table of files with size/modified columns like Documents, just a
   name + a couple of metadata lines, so a lightweight card grid reads
   better than forcing them into the file-table layout. */
.search-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.search-card {
  display: block;
  border: 1px solid var(--grey-border);
  border-radius: 8px;
  padding: 10px 12px;
  color: inherit;
  text-decoration: none;
  background: var(--white);
}
.search-card:hover {
  border-color: var(--elite-blue);
}
.search-card__title {
  font-weight: 700;
  margin-bottom: 2px;
}
.search-card__meta {
  font-size: 0.85rem;
  color: #666;
}

/* ---------- Upload progress (full-screen blocking overlay) ---------- */
/* Covers the whole viewport above everything else while an upload is in
   flight, so the visitor can't click or scroll away mid-upload without
   noticing - navigating away really would cancel it (see events.js). The
   explicit [hidden] override is needed because a plain class selector
   would otherwise beat the UA stylesheet's `[hidden] { display: none }`
   and leave the overlay visible before JS ever shows it. */
.upload-progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  padding: 24px;
}
.upload-progress-overlay[hidden] { display: none; }
.upload-progress-modal {
  background: #fff;
  border-radius: 8px;
  padding: 28px 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}
.upload-progress-modal__warning { margin: 14px 0 0; font-size: 0.85rem; color: #555; }
.upload-progress__bar-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--black-05);
  overflow: hidden;
}
.upload-progress__bar {
  height: 100%;
  width: 0%;
  background: var(--elite-blue);
  border-radius: 999px;
  transition: width 0.15s ease;
}
.upload-progress__label { margin: 6px 0 0; font-size: 0.85rem; color: #555; font-weight: 700; }

/* ---------- Equipment Quotes approve/deny reply popup ---------- */
/* Same full-screen-overlay + [hidden]-driven convention as
   .upload-progress-overlay above, reused here for visual consistency
   rather than inventing a new modal pattern. */
.quote-decision-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  padding: 24px;
}
.quote-decision-overlay[hidden] { display: none; }
.quote-decision-overlay__modal {
  background: #fff;
  border-radius: 8px;
  padding: 28px 32px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* ---------- Event photo/video lightbox (/events/browse) ---------- */
/* Same full-screen-overlay + [hidden]-driven convention as
   .upload-progress-overlay above, reused here for visual consistency
   rather than inventing a second modal pattern. See
   public/js/events-browse.js for the open/close/prev-next logic. */
.event-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.event-lightbox[hidden] { display: none; }
.event-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}
.event-lightbox__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 92vw;
  max-height: 92vh;
  padding: 0 64px;
}
.event-lightbox__media {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 80vh;
}
.event-lightbox__media img,
.event-lightbox__media video {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.event-lightbox__close {
  position: absolute;
  top: -44px;
  right: -8px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
}
.event-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  border: none;
  color: #fff;
  font-size: 2.5rem;
  line-height: 1;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.event-lightbox__nav:hover { background: rgba(0, 0, 0, 0.65); }
.event-lightbox__nav:disabled { opacity: 0.3; cursor: default; }
.event-lightbox__nav--prev { left: 0; }
.event-lightbox__nav--next { right: 0; }
.event-lightbox__footer {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 0.85rem;
  max-width: 100%;
}
.event-lightbox__caption {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60vw;
}
.event-lightbox__count { color: rgba(255, 255, 255, 0.7); flex-shrink: 0; }
@media (max-width: 640px) {
  .event-lightbox__dialog { padding: 0 44px; }
  .event-lightbox__nav { width: 36px; height: 36px; font-size: 1.8rem; }
  .event-lightbox__close { top: -40px; right: -4px; font-size: 1.6rem; }
}

/* ---------- Login ---------- */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black-05, #f5f5f5);
}
.login-card {
  background: #fff;
  border: 1px solid var(--grey-border);
  border-radius: 10px;
  padding: 40px 36px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
.login-card__logo { width: 160px; margin: 0 auto 20px; display: block; }
.login-card__heading {
  margin: 0 0 6px;
  font-size: 1.8rem;
  font-weight: 700;
}
.login-card__subheading {
  margin: 0 0 20px;
  font-size: 0.9rem;
  color: #666;
}
.login-card .page-subtitle { margin-bottom: 20px; }
.login-card .g_id_signin { display: flex; justify-content: center; margin-top: 8px; }
.login-status { margin-top: 12px; font-size: 0.9rem; color: #555; }
.login-card .notice { text-align: left; margin-bottom: 16px; }
.login-card .button { margin-top: 8px; }

.site-header__user {
  font-size: 0.85rem;
  color: #555;
  padding-right: 4px;
}

/* ---------- Quick Links ---------- */
.hero__quicklinks-button { display: inline-block; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.quicklink-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.quicklink-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  border: 1px solid var(--grey-border);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.quicklink-card:hover { border-color: var(--elite-blue); transform: translateY(-1px); }
.quicklink-card__name { font-weight: 700; font-size: 1.05rem; }
.quicklink-card__desc { color: #555; font-size: 0.9rem; }
.quicklink-card__url {
  color: var(--elite-blue);
  font-size: 0.8rem;
  word-break: break-all;
  margin-top: 4px;
}
.quicklink-card-wrap { display: flex; flex-direction: column; }
.quicklink-card__extra {
  border: 1px solid var(--grey-border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 10px 20px 14px;
  margin-top: -1px;
}

.form-row__optional { font-weight: 400; color: #888; font-size: 0.85em; }
.form-row--inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Dashboard event photo slideshow ---------- */
.homepage-featured { margin-top: 16px; }
.slideshow {
  position: relative;
  width: 100%;
  /*
    BUG FIX (2026-08-02, Brock): was 21/9, a very wide/short letterbox
    shape. Combined with object-fit: cover below (which crops WHATEVER
    doesn't fit the box), that meant a typical landscape photo (4/3 or
    16/9) got its top and bottom cropped off to force it into the 21/9
    strip, and a portrait photo lost even more off its sides - real event
    photos were losing people/signage/important content off the edges.
    16/9 is a much closer match to how most event photos are actually
    shot, so there's less mismatch to crop or letterbox away in the
    first place.
  */
  aspect-ratio: 16 / 9;
  max-height: 380px;
  /* On a narrow portrait phone even 16/9 squeezes things down - a taller
     ratio below the mobile breakpoint shows more of each photo. See the
     media query further down. */
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  margin-top: 8px;
}
.slideshow__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.9s ease;
}
.slideshow__slide.is-active { opacity: 1; }
.slideshow__slide img {
  width: 100%;
  height: 100%;
  /*
    BUG FIX (2026-08-02, Brock): switched from object-fit: cover to
    contain. cover crops whatever overflows the box's aspect ratio to
    fill it edge-to-edge - fine when a photo happens to match the box's
    shape, but aggressive (cropping out real content) for anything that
    doesn't, especially portrait photos in this wide box. contain instead
    shows the ENTIRE photo, uncropped, letterboxed (black bars, matching
    .slideshow's own background below) on whichever sides don't fill the
    box. Trades "always fills the box edge-to-edge" for "never crops a
    real photo" - the right tradeoff for a gallery where the actual photo
    content matters more than a perfectly filled rectangle.
  */
  object-fit: contain;
  object-position: center;
  display: block;
}
.slideshow__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
  color: #fff;
  font-size: 0.9rem;
}

.section__more-button { display: inline-block; margin-top: 16px; }
.section__header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section__header-row h2 { margin: 0; }

/* ---------- Pending Approvals ---------- */
.approval-list { display: flex; flex-direction: column; gap: 12px; }
.approval-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border: 1px solid var(--grey-border);
  border-radius: 8px;
}
.approval-card__title { font-weight: 700; }
.approval-card__meta { font-size: 0.85rem; color: #555; margin-top: 2px; }
.approval-card__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.approval-card__reject-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.approval-card__reject-form input[type="text"] {
  padding: 8px 10px;
  border: 1px solid var(--grey-border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  width: 180px;
}
@media (max-width: 480px) {
  /* A fixed 180px reason field doesn't leave much room next to its
     button on a narrow phone - let it fill the row instead. */
  .approval-card__reject-form input[type="text"] { width: 100%; }
}

/* ---------- Damaged Equipment: inline status badges ---------- */
.notice-inline {
  display: inline-block;
  font-size: 0.75rem;
  border-radius: 10px;
  padding: 2px 10px;
}
.notice-inline--ok { background: var(--ok-bg); border: 1px solid var(--ok-border); color: #145a32; }
.notice-inline--warn { background: var(--warn-bg); border: 1px solid var(--warn-border); color: #6b4a00; }

/* ---------- Version history / badges ---------- */
.version-badge {
  display: inline-block;
  font-size: 0.75rem;
  color: #555;
  border: 1px solid var(--grey-border);
  border-radius: 10px;
  padding: 1px 8px;
  margin-left: 6px;
}

/* ---------- Links (Forms & Templates external link entries) ---------- */
.link-list { list-style: none; margin: 16px 0 0; padding: 0; }
.link-list__item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--grey-border);
}
.link-list__item:last-child { border-bottom: none; }
.link-list__badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--elite-blue);
  border: 1px solid var(--elite-blue);
  border-radius: 10px;
  padding: 1px 8px;
}
.version-history-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.version-history-table th, .version-history-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--grey-border);
  font-size: 0.9rem;
}
.insurance-coc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.insurance-coc-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  padding: 18px 20px;
  border: 1px solid var(--grey-border);
  border-radius: 8px;
}
.insurance-coc-card h3 { margin: 0; }

/* white-space/overflow-wrap: same short-label fix as .button/.file-table
   th above - "Low stock"/"Expiring soon" etc. should never wrap. */
.status-pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 0.75rem; white-space: nowrap; overflow-wrap: normal; word-break: normal; }
.status-pill--current { background: #e6f4ea; color: #1a7f37; }
.status-pill--pending { background: #fff4e5; color: #a15c00; }
.status-pill--rejected { background: #fbe9e7; color: #b3261e; }
.status-pill--superseded { background: #eee; color: #666; }
.status-pill--archived { background: #f0e9fb; color: #5b3aa8; margin-left: 4px; }

.notice--info { background: #e8f0fe; border: 1px solid #b3c9f7; color: #1a3d7c; }
.version-history__reason { color: #b3261e; font-size: 0.8rem; }

/* ---------- Mobile adjustments (general) ---------- */
/* Everything else responsive is handled inline near the component it
   belongs to (nav collapse, tables, form-row--split, upload overlay is
   already viewport-relative by default). These are the few remaining
   tweaks that didn't have an obvious home next to a single component. */
@media (max-width: 640px) {
  .page { padding: 24px 16px 24px; }
  .site-header__inner { padding: 14px 16px; }
  .site-footer__inner { padding: 20px 16px; text-align: center; justify-content: center; }
  .hero h1 { font-size: 1.5rem; }
  /* 21/9 is quite short on desktop already; on a narrow portrait phone it
     squeezes each photo down to a thin strip, so use a taller ratio. */
  .slideshow { aspect-ratio: 4 / 3; max-height: none; }
}

/* Show Briefs (Brock's request, 2026-10-08) - two-column question grid
   shared by the form and the read-only detail page. */
.brief-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.brief-grid .brief-field--full { grid-column: 1 / -1; }
.brief-grid input[type="text"], .brief-grid input[type="email"], .brief-grid input[type="tel"],
.brief-grid input[type="date"], .brief-grid input[type="time"], .brief-grid select, .brief-grid textarea {
  width: 100%; box-sizing: border-box;
}
.brief-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.brief-checks label { font-weight: normal; display: flex; align-items: center; gap: 4px; }
.brief-rows { overflow-x: auto; }
.brief-rows table { width: 100%; border-collapse: collapse; }
.brief-rows th { text-align: left; font-size: 0.75rem; font-weight: normal; color: #555; padding: 0 6px 2px 0; }
.brief-rows td { padding: 0 6px 6px 0; }
.brief-rows td input { width: 100%; box-sizing: border-box; }
@media (max-width: 640px) {
  .brief-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Nested site folders need stacked cells so version links stay readable on phones. */
@media (max-width: 640px) {
  .project-file-browser .file-table td { display: block; text-align: left; }
  .project-file-browser .file-table td::before { display: block; width: auto; margin-bottom: 6px; text-align: left; }
  .project-file-browser .file-table td a { display: inline-block; }
}

/* Closing a confirmed save is distinct from acknowledging an uncertain result. */
#upload-progress-close-button { background:#e5e7eb; border-color:#c7cbd1; color:#4b5563; opacity:1; }
#upload-progress-close-button:disabled { cursor:not-allowed; }
#upload-progress-close-button[data-upload-confirmed="true"]:not(:disabled) { background:#0800f0; border-color:#0800f0; color:#fff; }

/* Personal OnRent jobs: at most twelve cards, four columns on desktop. */
.onrent-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;list-style:none;padding:0;margin:20px 0;}
.onrent-crew {display:flex;flex-direction:column;gap:5px;margin-top:12px;padding-top:12px;border-top:1px solid #d8dfe8;}
.onrent-crew small {color:#596579;line-height:1.4;}
.onrent-tile {min-width:0;border:1px solid #d8dfe8;border-radius:12px;padding:18px;background:#fff;overflow-wrap:anywhere;}
.onrent-tile a {display:block;font-weight:700;font-size:1.05rem;margin-bottom:12px;}
.onrent-progress {border-top:1px solid #e5e9ef;margin-top:16px;padding-top:12px;display:grid;gap:6px;font-size:.9rem;color:#344054;}
.onrent-progress strong {color:#165d46;font-size:1.05rem;}
@media(max-width:1150px){.onrent-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:600px){.onrent-grid{grid-template-columns:minmax(0,1fr);}}

.induction-instructions { margin: 1rem 0; padding: 1rem; border: 1px solid #dbe2e8; border-radius: 8px; }
.induction-instructions h4 { margin: 0 0 .5rem; }
.induction-instructions__text { white-space: pre-wrap; overflow-wrap: anywhere; }
.induction-instructions summary { cursor: pointer; }
.induction-instructions form { margin-top: .75rem; }
.induction-instructions textarea { display: block; width: 100%; box-sizing: border-box; resize: vertical; }

/* Compact document and folder browser; retain semantic links and version history. */
.file-type-icon{display:flex;width:64px;height:76px;align-items:center;justify-content:center;background:#eae7ff;color:#4930aa;border:1px solid #d5cff5;border-radius:8px 18px 8px 8px;font-weight:800;font-size:14px;letter-spacing:.04em;margin-bottom:16px}
.project-file-browser{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,230px),1fr));gap:16px;align-items:start}
.project-file-browser>.project-new-folder,.project-file-browser>.folder-recovery,.project-file-browser>button{grid-column:1/-1}
.project-file-browser>.event-group{min-width:0;margin-top:0!important;border-radius:12px;overflow:hidden}
.project-file-browser>.event-group[open]{grid-column:1/-1}
.project-file-browser>.event-group:not([open])>.event-group__summary{display:grid;grid-template-columns:22px minmax(0,1fr);grid-template-rows:4.2em 1.3em 32px;gap:8px 10px;padding:16px;align-items:start;box-sizing:border-box}
.project-file-browser>.event-group:not([open])>.event-group__summary::before{display:none}
.project-file-browser>.event-group:not([open])>.event-group__summary>.event-group__name{line-height:1.4;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.project-file-browser>.event-group:not([open])>.event-group__summary>.event-group__meta{grid-column:2;line-height:1.3;white-space:nowrap}
.project-file-browser>.event-group:not([open])>.event-group__summary>button{grid-column:2;justify-self:start;align-self:end}
.project-folder-icon{line-height:1.4;flex-shrink:0}
.project-file-browser .event-group__name{overflow-wrap:anywhere;min-width:0}
.project-dropzone{border:2px dashed #b9b1df;border-radius:12px;padding:18px;background:#faf9ff;margin:20px 0!important}
.project-dropzone__input{max-width:100%;margin-bottom:12px}
.file-card-grid{display:block;width:100%;border:0;background:transparent}
.file-card-grid>thead{display:none}
.file-card-grid>tbody{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,240px),1fr));gap:16px}
.file-card-grid>tbody>tr{display:flex;flex-direction:column;min-width:0;border:1px solid #dfe2ed;border-radius:12px;padding:18px;background:white;overflow-wrap:anywhere}
.file-card-grid>tbody>tr>td{display:block;padding:0;margin-bottom:14px;border:0;max-width:100%}
.file-card-grid>tbody>tr>td:before{display:none!important}
.file-card-grid input{max-width:100%;box-sizing:border-box}
.folder-options,.folder-recovery{padding:16px;border:1px solid #e0e3ed;border-radius:10px;margin-bottom:16px}
.folder-options label{display:flex;align-items:flex-start;gap:8px;margin:12px 0}.folder-options input[type=checkbox]{flex:0 0 auto}
.folder-recovery article{padding:14px 0;border-top:1px solid #eee}
@media(max-width:600px){.project-new-folder{flex-wrap:wrap}.project-file-browser{grid-template-columns:1fr}.file-card-grid>tbody{grid-template-columns:1fr}}
.consumable-print-selection{padding:16px;background:#f5f4ff;border:1px solid #d9d5ef;border-radius:10px;margin-bottom:20px}.consumable-print-selection button{margin:4px}.consumable-select{display:flex;gap:8px;align-items:flex-start;overflow-wrap:anywhere;margin-bottom:12px}.consumable-select input{flex-shrink:0;margin-top:3px}

/* Dedicated print selection keeps inventory controls on the main page. */
.consumable-picker-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,220px),1fr));gap:16px}
.consumable-picker-card{display:grid;grid-template-columns:24px minmax(0,1fr);gap:12px;padding:16px;border:1px solid #d8dce7;border-radius:12px;cursor:pointer;align-content:start}
.consumable-picker-card:has(input:checked){border-color:var(--elite-blue);background:#f4f4ff}
.consumable-picker-card input{width:20px;height:20px}
.consumable-picker-photo{display:flex;height:100px;align-items:center;justify-content:center;color:#666;font-size:.85rem;background:#f5f6f8;border-radius:6px}
.consumable-picker-photo img{width:100%;height:100%;object-fit:contain}
.consumable-picker-name{grid-column:1/-1;overflow-wrap:anywhere;font-weight:600}

/* Homepage action controls share a touch target and stay aligned across widths. */
.home-actions .announcement__actions { align-items: start; }
.home-actions .announcement__actions form { margin: 0; }
.home-actions .announcement__actions .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 148px;
  min-height: 44px;
  padding: 10px 16px;
  line-height: 22px;
}
.home-actions button:disabled { cursor: default; opacity: .65; }
.home-action-status { min-height: 1.5em; margin: 8px 0 0; }
.home-actions [data-completed] .announcement__title { text-decoration: line-through; }
