/* ---- Contemporary Nook brand typography (Mon R31) ------------------------
   Lion and Hare is the store's brand face (from the CN identity kit). It is
   used for HEADINGS, the brand mark and section titles -- deliberately NOT
   for body text or data tables: a display face at 13px across a 200-row
   inventory grid hurts legibility and slows scanning, which is the opposite
   of what a work tool needs. Display font for identity, workhorse for data.
   font-display:swap so text paints immediately and never blocks on the font.
   Self-hosted (16KB each, woff2) -- no third-party font CDN. */


/* ---- Webfonts for the PUBLIC STOREFRONT (Mon R31) ------------------------
   Chosen from Tools -> Typography; the storefront applies them in its own
   <style> block (storefront_preview.html). Keeper's own chrome deliberately
   does NOT use these -- Mon preferred the plain system stack internally.
   Three roles, never one font doing everything: display = personality,
   body = legibility at small sizes, mono = tabular figures so prices line up.
   All self-hosted woff2 -- no Google Fonts CDN call at runtime. */
/* Cormorant runs small and light next to a UI sans -- size it up so headings
   keep their weight on screen. */


/* Money and card numbers: tabular mono so digits align down a grid and read
   as precise rather than decorative (Mon R31). */
.card-thumb + span .price, .stat-value, td[data-label="Price"], td[data-label="Cost"],
td[data-label="Value"], .money, .price-cell {
  font-variant-numeric: tabular-nums;
}
.money, .price-cell {
  /* Tabular figures only -- no webfont. Keeper's chrome stays on system fonts
     (Mon preferred it that way, R31); the alignment is the useful part. */
  font-weight: 600;
}

/* Keeper's own chrome deliberately uses the plain system font stack -- Mon
   tried a brand face on headings in R31 and preferred it as it was, so Keeper
   downloads no webfonts at all. The storefront's fonts live in fonts.css. */


:root {
  /* Brand colors, sampled directly from the logo file. */
  --brand-red: #ec1946;
  --brand-blue: #2d3b97;

  --bg: #f7f7f5;
  --panel: #ffffff;
  --text: #0a0a0a;           /* always black in light mode, per brand request */
  --muted: #5a5a5a;
  --border: #e0ddd6;
  --accent: var(--brand-blue);
  --accent-text: #ffffff;
  --highlight: var(--brand-red);
  --highlight-text: #ffffff;
  --error: #b3261e;
  --success: #1e7a34;

  /* Nav bar theme vars. The bar IS theme-switched (per Mon, 2026-07-14);
     the logo image keeps its own white background and reads as a deliberate
     light "chip" on the dark bar -- never CSS-invert the logo itself, that
     would turn its red/blue into cyan/orange. */
  --nav-bg: #ffffff;
  --nav-border: #e0ddd6;
  --nav-link: var(--brand-blue);
  --nav-link-hover: var(--brand-red);
  --nav-muted: #5a5a5a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17140f;
    --panel: #221e17;
    --text: #f0ece3;         /* stays light in dark mode -- black text on a dark
                                 background would be unreadable */
    --muted: #a89f8f;
    --border: #3a342a;
    --accent: #6f86e0;        /* lighter blue for contrast on a dark background */
    --accent-text: #0a0a0a;
    --highlight: #ff5d7a;     /* lighter red for contrast on a dark background */
    --highlight-text: #0a0a0a;
    --error: #ff8a80;
    --success: #6fcf8a;
    --nav-bg: #1d1913;
    --nav-border: #3a342a;
    --nav-link: #8fa3ec;      /* lighter navy -- raw brand-blue is unreadable on dark */
    --nav-link-hover: #ff5d7a;
    --nav-muted: #a89f8f;
  }
}

/* Explicit overrides for the theme toggle -- these win over the OS-level
   prefers-color-scheme media query above regardless of which way the OS is
   set, since the toggle is a deliberate per-visitor choice, not just a
   default. data-theme is stamped onto <html> by the toggle's own JS. */
:root[data-theme="dark"] {
  --bg: #17140f;
  --panel: #221e17;
  --text: #f0ece3;
  --muted: #a89f8f;
  --border: #3a342a;
  --accent: #6f86e0;
  --accent-text: #0a0a0a;
  --highlight: #ff5d7a;
  --highlight-text: #0a0a0a;
  --error: #ff8a80;
  --success: #6fcf8a;
  --nav-bg: #1d1913;
  --nav-border: #3a342a;
  --nav-link: #8fa3ec;
  --nav-link-hover: #ff5d7a;
  --nav-muted: #a89f8f;
}
:root[data-theme="light"] {
  --bg: #f7f7f5;
  --panel: #ffffff;
  --text: #0a0a0a;
  --muted: #5a5a5a;
  --border: #e0ddd6;
  --accent: var(--brand-blue);
  --accent-text: #ffffff;
  --highlight: var(--brand-red);
  --highlight-text: #ffffff;
  --error: #b3261e;
  --success: #1e7a34;
  --nav-bg: #ffffff;
  --nav-border: #e0ddd6;
  --nav-link: var(--brand-blue);
  --nav-link-hover: var(--brand-red);
  --nav-muted: #5a5a5a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

h1 { font-size: 1.5rem; margin-bottom: 12px; }
h2 { font-size: 1.15rem; margin-top: 28px; }

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

.topnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 20px;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
}

.brand-group { display: flex; align-items: center; gap: 14px; }
.brand { font-weight: 600; display: flex; align-items: center; gap: 12px; }

.theme-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.theme-toggle-track {
  display: block;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--border);
  position: relative;
  transition: background 0.2s;
}
.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.theme-toggle-thumb::before { content: "\2600"; } /* sun -- light mode default */
:root[data-theme="dark"] .theme-toggle-track { background: var(--accent); }
:root[data-theme="dark"] .theme-toggle-thumb { transform: translateX(20px); }
:root[data-theme="dark"] .theme-toggle-thumb::before { content: "\1F319"; } /* moon */
/* The logo image has its own opaque white background -- rounding the
   corners makes it read as a deliberate light "chip" when the nav bar is
   dark, keeping the artwork's real brand colors intact. */
.brand-logo { height: 70px; width: auto; display: block; border-radius: 8px; }
.brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  border-left: 2px solid var(--nav-border);
  padding-left: 12px;
}
.brand-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  /* highlight/accent equal the raw brand colors in light mode and their
     brighter dark-mode variants in dark mode -- so KEEPER stays readable
     on the dark bar without hardcoding a second gradient. */
  background: linear-gradient(100deg, var(--highlight), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-subtitle {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-links { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.nav-links a { color: var(--nav-link); }
.nav-links a:hover { color: var(--nav-link-hover); }
.whoami { color: var(--nav-muted); font-size: 0.78rem; font-style: italic; white-space: nowrap; }

/* ---- Nav ticker + live staff presence (Mon R19: fills the white space
   between the logo and the nav links -- unacknowledged endorsements
   scroll across, who's-in/on-break/on-lunch shows as colored dots). Both
   are toggleable off per browser (localStorage), same convention as the
   transfer/acquisition column toggles. */
.nav-ticker-presence { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; overflow: hidden; }
.nav-ticker-presence.nav-ticker-presence-hidden .nav-ticker,
.nav-ticker-presence.nav-ticker-presence-hidden .nav-presence { display: none !important; }
.nav-ticker { flex: 1 1 auto; min-width: 0; overflow: hidden; position: relative; height: 20px; }
.nav-ticker-track { position: absolute; white-space: nowrap; will-change: transform; animation: nav-ticker-scroll linear infinite; }
.nav-ticker-item { display: inline-block; margin-right: 48px; font-size: 0.82rem; color: var(--nav-muted); }
.nav-ticker-item.urgent { color: var(--highlight); font-weight: 700; }
@keyframes nav-ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.nav-presence { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nav-presence-person {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.72rem; color: var(--nav-muted); white-space: nowrap;
}
.nav-presence-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: #9a9a9a; flex-shrink: 0;
}
.nav-presence-dot.working { background: var(--success); }
.nav-presence-dot.break, .nav-presence-dot.lunch { background: #e0a020; }
.nav-presence-dot.off { background: #9a9a9a; opacity: 0.5; }
.nav-ticker-toggle { border: none; background: none; cursor: pointer; opacity: 0.55; font-size: 0.95rem; flex-shrink: 0; padding: 2px 4px; }
.nav-ticker-toggle:hover { opacity: 1; }
/* On mobile the scrolling ticker is too cramped, but WHO'S IN is genuinely
   useful (Mon R26) -- keep the presence names as a centered strip below the
   logo row, drop just the ticker + its toggle. */
@media (max-width: 900px) {
  .nav-ticker-presence { order: 99; flex-basis: 100%; justify-content: center; overflow: visible; }
  .nav-ticker, .nav-ticker-toggle { display: none; }
  .nav-presence { flex-wrap: wrap; justify-content: center; gap: 10px; }
  .nav-presence-person { font-size: 0.8rem; }
}

.notification-bell {
  position: relative;
  font-size: 1.15rem;
  text-decoration: none;
  line-height: 1;
  padding: 4px;
}
.notification-count {
  position: absolute;
  top: -4px;
  right: -6px;
  background: var(--brand-red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 10px;
  min-width: 14px;
  text-align: center;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--nav-border);
  border-radius: 6px;
  font-size: 1.3rem;
  line-height: 1;
  padding: 4px 10px;
  cursor: pointer;
  color: var(--nav-link);
}

.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  background: none;
  border: none;
  font: inherit;
  color: var(--nav-link);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-dropdown-toggle:hover { color: var(--nav-link-hover); }
.nav-dropdown-toggle::after { content: "\25BE"; font-size: 0.7em; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 160px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  padding: 6px;
  flex-direction: column;
  z-index: 20;
}
.nav-dropdown-menu a {
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  /* The dropdown pop-out uses the theme-aware --panel background (unlike
     the nav bar itself, which stays light on purpose for the logo colors),
     so its links need theme-aware text too -- inheriting the nav's fixed
     brand-blue here was navy-on-near-black in dark mode, nearly unreadable. */
  color: var(--text);
}
.nav-dropdown-menu a:hover { background: var(--bg); text-decoration: none; }
.nav-menu-group { padding: 8px 10px 2px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); border-top: 1px solid var(--border); margin-top: 4px; }
.nav-dropdown.open .nav-dropdown-menu { display: flex; }

.session-widget-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 20px;
  background: #fff7e0;
  color: #0a0a0a;
  border-bottom: 1px solid var(--nav-border);
  flex-wrap: wrap;
}
.session-widget-bar.session-widget-paused { background: #f0f0f0; }
:root[data-theme="dark"] .session-widget-bar { background: #4a3f1f; color: #f0ece3; }
:root[data-theme="dark"] .session-widget-bar.session-widget-paused { background: #3a3a3a; }
.session-widget-label { font-size: 0.85rem; }
.session-widget-label strong { color: var(--brand-red); }
.session-inline-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.session-inline-form input[type="text"] {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}
.session-widget-actions { display: flex; gap: 6px; }
.session-widget-actions button {
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}
.session-widget-actions button:hover { border-color: var(--brand-blue); color: var(--brand-blue); }
.session-widget-actions button.session-stop-btn:hover { border-color: var(--brand-red); color: var(--brand-red); }

/* ---- Mobile nav drawer (Mon R26: "make it more fun and engaging, world-
   class UI/UX"). The bare stacked links become a rounded, shadowed panel:
   each row is a full-width tappable pill with a chevron, dropdowns expand
   as indented sub-lists, and the whole thing slides down. ---- */
@media (max-width: 800px) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    border-radius: 10px; padding: 7px 12px;
    transition: background 0.15s;
  }
  .topnav.nav-open .nav-toggle { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-top: 10px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.16);
  }
  .topnav.nav-open .nav-links { display: flex; animation: nav-drawer-in 0.22s ease; }
  @keyframes nav-drawer-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
  /* Every direct link is a full-width pill row */
  .nav-links > a {
    display: flex; align-items: center;
    padding: 13px 16px; border-radius: 12px;
    font-size: 1rem; font-weight: 600; color: var(--text);
    min-height: 48px;
  }
  .nav-links > a::before { content: "›"; margin-right: 10px; color: var(--accent); font-weight: 800; }
  .nav-links > a:hover, .nav-links > a:active { background: var(--bg); text-decoration: none; }
  .nav-dropdown { width: 100%; }
  .nav-dropdown-toggle {
    width: 100%; justify-content: space-between;
    padding: 13px 16px; border-radius: 12px; min-height: 48px;
    font-size: 1rem; font-weight: 700; color: var(--text);
  }
  .nav-dropdown.open .nav-dropdown-toggle { background: var(--bg); color: var(--accent); }
  .nav-dropdown-toggle::after { content: "\25BE"; transition: transform 0.2s; }
  .nav-dropdown.open .nav-dropdown-toggle::after { transform: rotate(180deg); }
  .nav-dropdown-menu {
    position: static; box-shadow: none; border: none;
    padding: 2px 0 6px 18px; width: 100%; gap: 1px;
  }
  .nav-dropdown-menu a { padding: 11px 14px; border-radius: 10px; font-size: 0.95rem; min-height: 42px; display: flex; align-items: center; }
  .nav-dropdown.open .nav-dropdown-menu { display: flex; }
  /* The logged-in name + Log out sit in a footer strip inside the drawer */
  .nav-links .whoami {
    order: 100; white-space: normal; text-align: center;
    padding: 12px 8px 4px; border-top: 1px solid var(--border); margin-top: 6px;
  }
  .nav-links > a[href="/logout"] { order: 101; justify-content: center; color: var(--highlight); }
  .nav-links > a[href="/logout"]::before { content: ""; margin: 0; }
  /* Search + bell become compact left-aligned icon pills, not full-width bars */
  .nav-links > #global-search-toggle,
  .nav-links > #notification-bell {
    width: auto; align-self: flex-start; min-height: 44px;
    margin: 8px 0 0 8px; padding: 8px 16px;
    background: var(--bg); color: var(--text);
    border: 1px solid var(--border); border-radius: 12px; box-shadow: none;
    display: inline-flex; align-items: center; gap: 8px;
  }
  .nav-links > #global-search-toggle::before { content: "Search"; font-size: 0.85rem; font-weight: 600; }
  .nav-links > #notification-bell::before { content: "Alerts"; font-size: 0.85rem; font-weight: 600; }
}

.login-page { position: relative; }

.login-bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.login-bg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: -1;
}

.login-box {
  position: relative;
  max-width: 340px;
  margin: 10vh auto 0;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}

form.stacked-form, form.login-box form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

form.contact-form { max-width: 420px; }

.endorsement-tag-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.endorsement-tag-list legend { padding: 0 6px; color: var(--muted); font-size: 0.85rem; }
.checkbox-label { flex-direction: row !important; align-items: center; gap: 6px; font-weight: normal; }

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
  color: var(--muted);
}

input, select, button {
  font-size: 1rem;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
}

/* Browsers default text-like inputs to ~20 characters wide, which cuts off
   longer placeholder/guide text and typed values in a lot of these forms.
   More specific rules elsewhere (qty inputs, schedule cells, etc.) still
   win over this thanks to higher selector specificity. */
input[type="text"], input[type="email"], input[type="password"],
input[type="search"], input[type="tel"], input[type="url"], input:not([type]) {
  min-width: 240px;
  max-width: 100%;
}
select { min-width: 160px; max-width: 100%; }

button {
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  cursor: pointer;
  padding: 9px 16px;
}

button:hover { opacity: 0.9; }

.link-button {
  background: none;
  color: var(--accent);
  border: none;
  padding: 0;
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
}
.link-button:hover { opacity: 1; color: var(--highlight); }

.error { color: var(--error); }
.success { color: var(--success); }
.muted { color: var(--muted); font-size: 0.9rem; }

/* Attention strip, e.g. "N merchandise items have no price yet" */
.warning-banner {
  padding: 8px 14px;
  background: color-mix(in srgb, var(--brand-red) 8%, var(--panel));
  border: 1px solid var(--brand-red);
  border-radius: 8px;
  font-size: 0.9rem;
}

/* ---- Task Board (Trello-style columns + draggable cards) ---- */
.board-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: start;
  margin: 16px 0;
}
@media (max-width: 900px) {
  .board-columns { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .board-columns { grid-template-columns: 1fr; }
}
.board-col {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 120px;
}
.board-col-title { font-size: 1rem; margin: 0 0 10px; }
.board-col-cards { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.board-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand-blue);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: grab;
}
.board-card:active { cursor: grabbing; }
.board-card.dragging { opacity: 0.5; }
.board-card-title { font-weight: 600; display: block; margin-bottom: 6px; }
.board-card-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 0.8rem; }
.board-col-cards.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: 4px;
  border-radius: 8px;
}
.board-activity { display: flex; flex-direction: column; gap: 10px; }
.board-activity-entry {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 8px 12px;
}
.board-activity-photo { max-width: 240px; max-height: 240px; border-radius: 6px; margin-top: 6px; }

/* Collapsible form panel (Add an item / Bulk upload) */
.panel-details {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  padding: 8px 14px;
  margin-bottom: 12px;
}
.panel-details summary { cursor: pointer; font-weight: 600; }
.panel-details form { margin-top: 10px; }

.summary-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.stat {
  display: flex;
  flex-direction: column;
  padding: 12px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: 3px solid var(--brand-blue);
  border-radius: 8px;
  min-width: 130px;
}

.stat-value { font-size: 1.4rem; font-weight: 600; }
.stat-label { font-size: 0.8rem; color: var(--muted); }

.search-form { display: flex; gap: 8px; margin-bottom: 16px; }
.search-form input { flex: 1; }

.locations-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  font-size: 0.85rem;
}
.chip-toggle { cursor: pointer; color: var(--accent); font-weight: 600; }
#all-locations-chips { display: contents; }
.chip-with-reason { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 5px 12px; text-decoration: none; color: var(--text); }
.chip-with-reason:hover { border-color: var(--accent); }
.chip-reason { font-size: 0.68rem; color: var(--muted); font-weight: 400; }

.report-links { display: flex; flex-wrap: wrap; gap: 16px; }
.report-card {
  display: block;
  width: 220px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: 3px solid var(--brand-red);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}
.report-card:hover { border-top-color: var(--brand-blue); }
.report-card h2 { margin: 0 0 6px; font-size: 1.05rem; }
.report-card p { margin: 0; font-size: 0.85rem; color: var(--muted); }

.preset-links { display: flex; gap: 6px; margin: 8px 0 16px; flex-wrap: wrap; }
.preset-links a {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  text-decoration: none;
}
.preset-links a.active { background: var(--brand-blue); color: #fff; border-color: var(--brand-blue); }

.bulk-actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  margin-bottom: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.bulk-actions-bar .bulk-form { gap: 6px; }
#bulk-selected-count { font-size: 0.85rem; }

.aging-export-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

#cam-preview {
  width: 100%;
  max-width: 420px;
  border-radius: 8px;
  background: #000;
  display: block;
  margin-bottom: 14px;
}
.attendance-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.attendance-btn {
  padding: 10px 16px;
  font-size: 1rem;
  background: var(--brand-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.attendance-btn:hover { opacity: 0.9; }
.attendance-btn:disabled { opacity: 0.5; cursor: default; }

.help-layout { display: flex; gap: 28px; align-items: flex-start; }
.help-sidebar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
  position: sticky;
  top: 16px;
}
.help-sidebar a {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  text-decoration: none;
}
.help-sidebar a.active { background: var(--brand-blue); color: #fff; }
.help-content { flex: 1; min-width: 0; }
.help-content h2 { margin-top: 24px; }
@media (max-width: 700px) {
  .help-layout { flex-direction: column; }
  .help-sidebar { flex-direction: row; flex-wrap: wrap; position: static; }
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.photo-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.photo-card img { width: 100%; display: block; aspect-ratio: 4 / 3; object-fit: cover; }
.photo-select {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  width: 18px;
  height: 18px;
}
.photo-caption form { margin-top: 4px; }
.photo-missing {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.85rem;
}
.photo-caption { padding: 8px 10px; font-size: 0.85rem; margin: 0; }
.event-thumb { width: 60px; height: 45px; object-fit: cover; border-radius: 4px; display: block; }

.stamp-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: inherit;
}
.stamp-link:hover { text-decoration: none; }
.stamp-link .event-thumb { width: 40px; height: 30px; }
.stamp-link span { text-decoration: underline; }
.stamp-link:hover span { color: var(--brand-red); }

.dev-changelog-entry {
  padding: 14px 18px;
  margin-bottom: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand-red);
  border-radius: 8px;
}
.dev-changelog-entry h2 { margin: 0 0 4px; font-size: 1.05rem; }
.dev-changelog-summary { white-space: pre-line; margin-top: 8px; }

.table-wrap { overflow-x: auto; }
.sortable-col { cursor: pointer; user-select: none; white-space: nowrap; }
.sortable-col:hover { color: var(--accent); }
.sortable-col::after { content: " \21C5"; font-size: 0.75em; opacity: 0.45; }
.sortable-col.sorted-asc::after { content: " \25B2"; opacity: 1; }
.sortable-col.sorted-desc::after { content: " \25BC"; opacity: 1; }
table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
th { color: var(--muted); font-weight: 500; }

/* Sticky header row on every data table (Mon R21: "if I'm scrolling all
   the way down I don't know if it's a location, a variant, a card, a
   value, a cost"). No explicit <thead> in these templates, so this
   targets the first row specifically -- the same header-row convention
   the click-to-sort JS already relies on. */
.table-wrap table tr:first-child th {
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 5;
  box-shadow: 0 1px 0 var(--border);
}

.foil-tag {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--brand-blue);
  color: #ffffff;
}

.treatment-tag {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--brand-red);
  color: var(--brand-red);
}

th a { color: var(--muted); }
th a:hover { color: var(--brand-red); }

.qty-form, .inline-form, .transfer-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.qty-form > *, .inline-form > *, .transfer-form > * { flex-shrink: 0; }
.qty-form input[type="number"] { width: 64px; }
.transfer-form { min-width: 340px; }
.transfer-form input[name="destination"] { width: 160px; }
.transfer-form input[name="quantity"] { width: 56px; }
.transfer-form input[name="new_listing_price"] { width: 100px; }

.qty-form.flash-ok input, .sell-form.flash-ok button, .transfer-form.flash-ok input {
  outline: 2px solid var(--success);
}
.qty-form.flash-err input, .sell-form.flash-err button, .transfer-form.flash-err input {
  outline: 2px solid var(--error);
}

.toast-stack {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 320px;
}
.toast {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--success);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.toast-in { opacity: 1; transform: translateY(0); }
.toast.toast-out { opacity: 0; transform: translateY(8px); }

.sell-actions { display: flex; flex-direction: column; gap: 4px; min-width: 200px; }
.sell-buttons { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sell-buttons input[type="number"] { width: 60px; flex-shrink: 0; }
.sell-form button { padding: 6px 10px; font-size: 0.85rem; background: var(--highlight); color: var(--highlight-text); flex-shrink: 0; }
.sell-form button:disabled, .sell-form input:disabled { opacity: 0.35; cursor: not-allowed; }

.sale-details { font-size: 0.85rem; color: var(--muted); }
.sale-details summary { cursor: pointer; color: var(--accent); }
.sale-details input, .sale-details select {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  padding: 5px 8px;
  width: 200px;
}

/* min-width: 0 opts these out of the global 240px input floor above --
   inside a Counter tile or a table row, 240px overflows the container
   (Mon R23: "customer name field extends in desktop mode"). */
.sell-customer { width: 150px; min-width: 0; font-size: 0.85rem; padding: 5px 8px; }
.new-customer-hint {
  display: none;
  font-size: 0.75rem;
  color: var(--accent);
  margin-left: 4px;
}
.payment-select-sm { width: 130px !important; }
.price-override-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}
.price-override-toggle input[type="checkbox"] { margin: 0; }
.price-override-input { width: 200px; }

/* Transfer column: hidden by default (not a daily action), revealed by the
   "Show transfer options" toggle -- see app.js. */
.transfer-col { display: none; }
table.show-transfer .transfer-col { display: table-cell; }

/* Acquisition-location column: same hide-by-default pattern as transfer --
   useful to see where a card was sourced from, but not a daily need. */
.acq-col { display: none; }
table.show-acq .acq-col { display: table-cell; }

.schedule-table th, .schedule-table td { white-space: nowrap; }
.schedule-table input[type="text"] { width: 130px; }
.schedule-table-wrap {
  max-height: 70vh;
  overflow-y: auto;
}
.schedule-table tr:first-child th {
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 5;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}
.schedule-table td:first-child, .schedule-table th:first-child {
  position: sticky;
  left: 0;
  background: var(--panel);
  z-index: 4;
}
.schedule-table th:first-child { z-index: 6; }
.schedule-table .schedule-group-row td { position: static; }
.schedule-group-row td {
  background: var(--panel);
  color: var(--muted);
  padding-top: 12px;
  border-bottom: 1px solid var(--border);
}
.roster-remove { font-size: 0.75rem; color: var(--muted); background: none; padding: 0; margin-left: 4px; }
.roster-remove:hover { color: var(--brand-red); }

.result-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 20px;
}

.calc-grid { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.calc-grid .result-box { flex: 1; min-width: 300px; }
.calc-grid label { margin-bottom: 12px; }
.calc-grid input[type="number"] { width: 100%; box-sizing: border-box; }
.calc-grid table td { padding: 6px 10px; vertical-align: top; }
.calc-grid table td:last-child { text-align: right; font-family: monospace; font-size: 1rem; white-space: nowrap; }

.quick-sale-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.quick-sale-tile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  /* Belt-and-braces: no child (input, select, photo) may ever paint past
     the tile edge again, whatever future width rules appear (Mon R24). */
  overflow: hidden;
  min-width: 0;
}
.quick-sale-tile input, .quick-sale-tile select { max-width: 100%; min-width: 0; }
.quick-sale-name { font-weight: bold; }
.quick-sale-category { font-size: 0.78rem; }
.quick-sale-price { font-size: 1.2rem; }
.quick-sale-qty { font-size: 0.85rem; }
.quick-sale-form .sell-buttons { justify-content: center; }
.quick-sale-form input[type="number"] { width: 52px; }
.quick-sale-button {
  padding: 14px 10px;
  font-size: 1.05rem;
  font-weight: bold;
  background: var(--highlight);
  color: var(--highlight-text);
  border-radius: 8px;
  width: 100%;
}
.calc-grid .formula { font-size: 0.78rem; font-weight: normal; margin-top: 2px; }

.merch-photo { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; display: block; }
.merch-photo-add { color: var(--accent); font-size: 0.8rem; cursor: pointer; white-space: nowrap; display: block; background: none; border: none; padding: 0; margin-top: 2px; font-family: inherit; }
.merch-photo-add:hover { text-decoration: underline; }

/* ---- Camera-capture modal (Mon R19: same live-camera pattern as
   biometrics clock-in, reused anywhere a quick reference photo helps) ---- */
.camera-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 4000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.camera-modal {
  background: var(--panel); border-radius: 12px; padding: 16px;
  max-width: 480px; width: 100%; display: flex; flex-direction: column; gap: 10px;
}
.camera-modal video { width: 100%; border-radius: 8px; background: #000; max-height: 60vh; }
.camera-modal-actions { display: flex; gap: 10px; }
.camera-modal-actions button { flex: 1; }
.camera-snap { background: var(--highlight); color: var(--highlight-text); }

/* ---- Clock-in welcome popup (Mon R19: "Welcome to work" + time-of-day art
   + a rotating quote) -- one overlay, four background themes swapped by a
   class matching the PH-time period computed server-side at the moment of
   the actual Login clock event. */
.welcome-popup-overlay {
  position: fixed; inset: 0; z-index: 5000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  opacity: 0; transition: opacity 0.3s ease;
}
.welcome-popup-overlay.welcome-popup-in { opacity: 1; }
.welcome-popup-sunrise { background: linear-gradient(160deg, #ff9a56 0%, #ff6a88 55%, #6a5acd 100%); }
.welcome-popup-day { background: linear-gradient(160deg, #6dc0ff 0%, #4a90e2 60%, #2d3b97 100%); }
.welcome-popup-sunset { background: linear-gradient(160deg, #ff7e5f 0%, #a8102f 60%, #2d1b4e 100%); }
.welcome-popup-night { background: linear-gradient(160deg, #1c1e3a 0%, #2d2b55 55%, #0a0a14 100%); }
.welcome-popup-card {
  background: var(--panel); border-radius: 16px; padding: 32px 28px; max-width: 420px; width: 100%;
  text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  transform: scale(0.85) translateY(10px); transition: transform 0.3s ease;
}
.welcome-popup-overlay.welcome-popup-in .welcome-popup-card { transform: scale(1) translateY(0); }
.welcome-popup-emoji { font-size: 3.2rem; line-height: 1; margin-bottom: 10px; animation: welcome-emoji-bob 2.4s ease-in-out infinite; }
@keyframes welcome-emoji-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.welcome-popup-card h2 { margin-bottom: 14px; }
.welcome-popup-quote { color: var(--muted); font-style: italic; line-height: 1.5; margin-bottom: 20px; }
.welcome-popup-dismiss { background: var(--highlight); color: var(--highlight-text); font-weight: 700; padding: 10px 24px; border-radius: 8px; border: none; cursor: pointer; }

/* ---- Password show/hide eye icon (Mon R19/R20: every masked field app-wide,
   wrapped generically by app.js so no template needed the input's markup
   touched). */
.password-field-wrap { position: relative; display: flex; align-items: center; width: 100%; }
.password-field-wrap input[type="password"],
.password-field-wrap input[type="text"] { padding-right: 52px; width: 100%; }
.password-toggle-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: none; cursor: pointer; font-size: 0.78rem;
  color: var(--accent); font-weight: 600; opacity: 0.7; padding: 2px 4px; line-height: 1;
}
.password-toggle-btn:hover { opacity: 1; }
.password-toggle-btn.password-toggle-active { opacity: 1; }

/* ---- Toggle switch (Mon R19: Counter on/off reads better as a switch than
   an "On -- Remove" / "Off -- Add" button) ---- */
.switch-toggle { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch-toggle input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; inset: 0; background: var(--border); border-radius: 999px;
  cursor: pointer; transition: background 0.15s;
}
.switch-slider::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.switch-toggle input:checked + .switch-slider { background: var(--success); }
.switch-toggle input:checked + .switch-slider::before { transform: translateX(18px); }
.quick-sale-photo { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; display: block; }
.quick-sale-customer, .quick-sale-payment { width: 100% !important; min-width: 0; box-sizing: border-box; font-size: 0.8rem; }
.quick-sale-payment { margin-top: 4px; }

.quick-action-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.quick-action-link {
  display: inline-block;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  font-weight: bold;
}
.quick-action-link:hover { background: var(--bg); text-decoration: none; }

.photo-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  cursor: zoom-out;
}
.photo-overlay img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 8px;
  background: #fff;
}
img.zoomable { cursor: zoom-in; }

/* ---- Endorsement priority badges + urgent SLA tracker ---- */
.priority-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.priority-urgent { background: var(--highlight); color: var(--highlight-text); }
.priority-mid { background: var(--accent); color: var(--accent-text); }
.priority-low { background: var(--border); color: var(--text); }
.endorsement-overdue td { background: rgba(236, 25, 70, 0.08); }
.notification-count-overdue { animation: bell-pulse 1.2s ease-in-out infinite; }
@keyframes bell-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

/* ---- Progress bar inside a disabled "Working..." button ---- */
/* The fill eases toward ~96% and holds -- the request's real duration is
   unknown (the server processes synchronously and then navigates), so
   this is a "we're alive and moving" indicator, not a measured percent. */
.btn-loading { position: relative; overflow: hidden; }
.btn-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--brand-red);
  opacity: 0.45;
  pointer-events: none;
  animation: btn-progress-fill 25s cubic-bezier(0.1, 0.7, 0.3, 1) forwards;
}
.btn-progress-blue { background: var(--brand-blue); }
@keyframes btn-progress-fill {
  0% { width: 0; }
  40% { width: 62%; }
  75% { width: 85%; }
  100% { width: 96%; }
}

/* ---- Mobile responsiveness ---- */
/* Staff do real work from their phones: attendance, inventory checks,
   search, and the Counter. Tables that only horizontally scroll are a bad
   phone experience, so the key tables collapse into stacked cards below
   700px (rows become bordered blocks; each cell shows its column label
   from data-label). Everything else gets bigger touch targets and inputs
   that don't trigger iOS auto-zoom. */
@media (max-width: 640px) {
  main { padding: 14px 12px 48px; }
  h1 { font-size: 1.25rem; }
  .brand-logo { height: 48px; }
  .brand-title { font-size: 1.05rem; }
  .topnav { padding: 8px 12px; }
  button, .quick-action-link { min-height: 44px; }
  input, select, textarea { font-size: 16px; } /* below 16px, iOS zooms the page on focus */
  input[type="text"], input[type="email"], input[type="password"],
  input[type="search"], input[type="tel"], input[type="url"], input:not([type]) {
    min-width: 0;
    width: 100%;
  }
  .search-form { flex-wrap: wrap; }
  .search-form input { min-width: 100%; }
  .quick-sale-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .quick-action-buttons { flex-wrap: wrap; }
}

@media (max-width: 700px) {
  .mobile-cards tr:first-child { display: none; } /* the header row */
  .mobile-cards, .mobile-cards tbody { display: block; }
  .mobile-cards tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
    margin-bottom: 10px;
    padding: 8px 12px;
  }
  .mobile-cards td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    border: none;
    padding: 4px 0;
    text-align: right;
  }
  .mobile-cards td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    font-size: 0.78rem;
    flex-shrink: 0;
    text-align: left;
  }
  .mobile-cards td:not([data-label]) { justify-content: flex-end; }
  /* A cell the template marks as empty-on-mobile disappears entirely. */
  .mobile-cards td.mobile-hide-empty:empty { display: none; }

  /* ---- Compact 2-up variant (Facebook posts): two card boxes per row,
     compressed for the morning order-collection workflow (Mon 2026-07-15).
     Desktop is untouched; .m-only/.m-hide swap set NAME for set CODE and
     full condition words for NM/LP-style codes. ---- */
  .mobile-compact tbody { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .mobile-compact tr { margin-bottom: 0; padding: 7px 9px; }
  .mobile-compact td { padding: 2px 0; font-size: 0.82rem; }
  .mobile-compact td.m-skip, .mobile-compact .m-skip { display: none; }
  /* Self-evident cells drop their labels to save width; Profit/Left keep
     tiny ones so the numbers stay unambiguous. */
  .mobile-compact td[data-label="Card"]::before,
  .mobile-compact td[data-label="Set"]::before,
  .mobile-compact td[data-label="Condition"]::before,
  .mobile-compact td[data-label="FB Price"]::before { display: none; }
  .mobile-compact td[data-label]::before { font-size: 0.68rem; }
  .mobile-compact .sell-actions { min-width: 0; }
  .mobile-compact .sell-buttons input[type="number"] { width: 46px; }
  .mobile-compact .qty-form input[type="number"] { width: 50px; }
  .mobile-compact .sell-form button { padding: 6px 8px; font-size: 0.78rem; }
  /* Card thumbnail in a half-width 2-up card (Mon R24: "make it tight,
     intuitive, easy to touch"): image on top, name under it, centered --
     the side-by-side desktop layout is too cramped at ~170px wide. */
  .mobile-compact .card-cell { flex-direction: column; align-items: center; text-align: center; gap: 6px; width: 100%; }
  /* Mon R26: card image should nearly fill the 2-up card so staff can
     eyeball the art. A 2-up card is ~46vw wide; the thumbnail fills it at
     the real MTG card ratio (0.716) minus the tile padding. */
  .mobile-compact .card-thumb { width: 100%; max-width: 150px; height: auto; aspect-ratio: 5 / 7; border-radius: 8px; }
  .mobile-compact td[data-label="Card"] { justify-content: center; text-align: center; }
  /* The bulk-select checkbox pins to the tile's top-right corner on mobile
     so Lock/Unlock Selected works there too (Mon R26). */
  .mobile-compact tr { position: relative; }
  .mobile-compact .select-cell { position: absolute; top: 6px; right: 8px; padding: 0; justify-content: flex-end; }
  .mobile-compact .select-cell::before { display: none; }
  .mobile-compact .select-cell input[type="checkbox"] { width: 22px; height: 22px; }
  .mobile-compact td[data-label="Set"], .mobile-compact td[data-label="Condition"] {
    justify-content: center; text-align: center; font-size: 0.74rem; color: var(--muted);
  }
  .mobile-compact td[data-label="Qty"]::before { font-size: 0.68rem; }
  /* Fat-finger friendly: taller tap targets on the two actions staff
     actually use from the floor (update qty, mark sold). */
  .mobile-compact .qty-form button, .mobile-compact .sell-form button[type="submit"] { min-height: 38px; }
  .mobile-compact .sell-buttons input[type="number"],
  .mobile-compact .qty-form input[type="number"] { min-height: 36px; }
}
@media (min-width: 701px) {
  .m-only { display: none; }
}
@media (max-width: 700px) {
  .m-hide { display: none; }
  /* The transfer form's desktop min-width overflows a phone-width card
     (destination + qty + price side by side); let it wrap instead. */
  .mobile-cards .transfer-form { min-width: 0; }
  .mobile-cards .transfer-form input[name="destination"] { width: 100%; }
}

/* ---- Certificate of Employment: a clean A4-ish sheet, print-friendly ---- */
.coe-sheet {
  max-width: 720px;
  margin: 0 auto;
  background: #ffffff;
  color: #0a0a0a; /* the certificate is a printed document -- always light */
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 48px 56px 64px;
  line-height: 1.7;
}
.coe-letterhead { display: flex; align-items: center; gap: 20px; border-bottom: 2px solid #2d3b97; padding-bottom: 16px; }
.coe-logo { height: 64px; width: auto; }
.coe-company span { font-size: 0.85rem; color: #5a5a5a; }
.coe-title { text-align: center; letter-spacing: 0.15em; margin: 36px 0 28px; font-size: 1.2rem; color: #0a0a0a; }
.coe-body { margin: 18px 0; text-align: justify; }
.coe-signature { margin-top: 72px; }
.coe-sign-line { display: inline-block; border-top: 1px solid #0a0a0a; padding-top: 4px; min-width: 260px; font-weight: 700; }
.coe-sign-title { color: #5a5a5a; font-size: 0.9rem; }
@media print {
  .topnav, #session-widget, .no-print, .toast-stack { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .coe-sheet { border: none; border-radius: 0; padding: 24px 12px; }
}

/* ---- Global search overlay ---- */
.global-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 3000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}
.global-search-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: min(560px, 92vw);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
#global-search-input {
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 16px 18px;
  font-size: 1.05rem;
  min-width: 0;
  width: 100%;
}
#global-search-input:focus { outline: none; }
.global-search-results { overflow-y: auto; padding: 6px; }

/* ---- Task Board card popup (Mon R21: clicking a CARD pops it out small;
   the board itself stays a normal page -- "it doesn't have to be like a
   giant box, like it's just enough"). Same fixed/backdrop convention as the
   search overlay above, but sized as a compact card-detail popup rather
   than the near-fullscreen whole-board panel this started as. The iframe
   loads the real /board/{id} page as-is, so its existing detail view,
   comments, and edit forms all keep working untouched inside the popup. */
.board-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 3vw;
}
.board-modal-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: min(640px, 100%);
  height: min(640px, 85vh);
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.board-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}
#board-modal-close {
  border: none;
  background: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 2px 6px;
}
#board-modal-close:hover { color: var(--text); }
#board-modal-frame { flex: 1; width: 100%; border: none; background: var(--bg); }
@media (max-width: 700px) {
  .board-modal-overlay { padding: 0; }
  .board-modal-panel { border-radius: 0; width: 100%; height: 100%; }
}
.gs-group-label {
  font-family: -apple-system, "Segoe UI", sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 12px 4px;
}
.gs-result {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}
.gs-result:hover, .gs-result.gs-active { background: var(--bg); text-decoration: none; }
.gs-empty { padding: 18px; color: var(--muted); text-align: center; }

/* ---- Floating jump-to-top/bottom buttons (Audit Mode, Mon R23) ---- */
.scroll-jump-buttons {
  position: fixed;
  right: 14px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 900;
}
.scroll-jump-buttons button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  opacity: 0.85;
}
.scroll-jump-buttons button:hover { opacity: 1; }

/* ---- Tiny card thumbnails (Mon R23: Scryfall CDN images, lazy-loaded,
   zero database weight -- click zooms to the full scan) ---- */
.card-cell { display: flex; align-items: center; gap: 8px; }
.card-thumb {
  width: 42px;
  height: 58px;
  object-fit: cover;
  border-radius: 3px;
  cursor: zoom-in;
  flex-shrink: 0;
  background: var(--border);
}
@media (max-width: 700px) {
  .card-thumb { width: 56px; height: 78px; }
}

/* ---- Payslip sheet (Mon R25: MSV Group of Companies salary slip) ---- */
.payslip-meta, .payslip-lines { width: 100%; border-collapse: collapse; margin: 18px 0; }
.payslip-meta td, .payslip-lines td, .payslip-lines th {
  border: 1px solid #444; padding: 7px 10px; color: #0a0a0a; font-size: 0.92rem;
}
.payslip-lines th { background: #eef0f8; color: #2d3b97; text-align: left; }
.payslip-lines .amt { text-align: right; white-space: nowrap; }
.payslip-totals td { border-top: 2px solid #0a0a0a; }
.payslip-net {
  text-align: right; font-size: 1.05rem; border: 2px solid #0a0a0a;
  padding: 10px 14px; display: block; margin-left: auto; width: fit-content;
}

/* ---- Employee Handbook (Mon R25: corporate page for the MSV handbook) ---- */
.handbook-header { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.handbook-related {
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 14px; margin-bottom: 16px; font-size: 0.9rem;
}
.handbook-layout { display: flex; gap: 28px; align-items: flex-start; }
.handbook-toc {
  position: sticky; top: 16px; flex: 0 0 240px; max-height: 85vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; font-size: 0.85rem;
}
.handbook-toc ul { list-style: none; padding: 0; margin: 8px 0 0; }
.handbook-toc li { margin: 5px 0; }
.handbook-toc li.toc-sub { padding-left: 14px; font-size: 0.8rem; }
.handbook-body {
  flex: 1 1 auto; min-width: 0; background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px; padding: 28px 34px; line-height: 1.7;
}
.handbook-body h1 { font-size: 1.3rem; margin-top: 34px; border-bottom: 2px solid var(--accent); padding-bottom: 6px; }
.handbook-body h2 { font-size: 1.05rem; margin-top: 24px; color: var(--accent); }
.handbook-body table { border-collapse: collapse; margin: 12px 0; max-width: 100%; }
.handbook-body td, .handbook-body th { border: 1px solid var(--border); padding: 6px 10px; }
.handbook-body img { max-width: 100%; height: auto; }
@media (max-width: 900px) {
  .handbook-layout { flex-direction: column; }
  .handbook-toc { position: static; flex: none; width: 100%; max-height: 240px; }
}

/* ---- Mobile sort bar (Mon R26: the desktop sort links live in the table
   header row, which is hidden on phones -- this replaces them). Shown only
   under 700px via the .m-only wrapper. ---- */
.mobile-sort { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.mobile-sort a {
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
  font-size: 0.82rem; background: var(--panel); white-space: nowrap;
}
.mobile-sort a.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* ---- Hidden columns must STAY hidden on mobile cards (Mon R26) ----
   In the mobile-cards layout, `.mobile-cards td { display: flex }` was
   overriding the desktop `.acq-col/.transfer-col { display: none }` by
   specificity, so Transfer-to and Acquired-from leaked onto every phone
   card and ate space. Re-hide them with higher specificity, and honor the
   show-transfer/show-acq toggles the same way desktop does. */
@media (max-width: 700px) {
  .mobile-cards td.transfer-col, .mobile-cards td.acq-col { display: none; }
  table.show-transfer.mobile-cards td.transfer-col,
  table.show-acq.mobile-cards td.acq-col { display: flex; }
}

/* ---- Employee file header (Mon R26: photo, employee number, account type,
   role) -- a proper profile card, avatar with initial fallback. ---- */
.employee-header { display: flex; gap: 20px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.employee-avatar {
  width: 92px; height: 92px; object-fit: cover; border-radius: 16px; flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.employee-avatar-empty {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--highlight));
  color: #fff; font-size: 2.4rem; font-weight: 800;
}
.employee-header-info h1 { margin: 0 0 2px; }
.employee-designation { margin: 0 0 8px; color: var(--muted); font-size: 1rem; }
.employee-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.emp-badge {
  font-size: 0.75rem; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--border); color: var(--muted);
}
.emp-badge-id { background: var(--accent); color: var(--accent-text); border-color: var(--accent); letter-spacing: 0.04em; }
.emp-badge-service { color: var(--success); border-color: var(--success); }

/* ---- FB post template picker (Mon R26: choose a layout before generating) ---- */
.template-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 16px 0; }
.template-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--panel); color: var(--text); transition: border-color 0.15s, transform 0.1s;
}
.template-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.template-card strong { font-size: 1.05rem; }
.template-card .template-go { color: var(--accent); font-weight: 600; margin-top: 4px; }

/* ---- Article "generating" state (Mon R27: background chain + auto-refresh) ---- */
.article-generating { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin: 14px 0; max-width: 760px; }
.progress-bar-anim { height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; margin-bottom: 12px; }
.progress-bar-anim span { display: block; height: 100%; width: 40%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--highlight)); animation: prog-slide 1.4s ease-in-out infinite; }
@keyframes prog-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(320%); } }

/* Proprietary footer notice (R28 IP hygiene) */
.app-footer {
  margin: 48px auto 24px;
  padding: 16px 20px 0;
  max-width: 1200px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: center;
}
.app-footer-sep { opacity: 0.5; }

/* ---- Spoiler gallery (Mon 2026-07-16) ---- */
.spoiler-settabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.spoiler-settab {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px;
  border: 1px solid var(--border); border-radius: 20px; text-decoration: none;
  color: var(--text); background: var(--panel); font-size: 0.9rem;
}
.spoiler-settab.is-active { border-color: var(--brand-red); border-width: 2px; font-weight: 600; }
.spoiler-seticon { width: 20px; height: 20px; }
.spoiler-filters { margin: 14px 0; display: flex; flex-direction: column; gap: 8px; }
.spoiler-chiprow { display: flex; flex-wrap: wrap; gap: 6px; }
.spoiler-chip {
  padding: 5px 12px; border: 1px solid var(--border); border-radius: 16px;
  text-decoration: none; color: var(--text); background: var(--panel); font-size: 0.85rem;
}
.spoiler-chip.is-active { background: var(--brand-red); color: #fff; border-color: var(--brand-red); }
.spoiler-chip.is-active .muted { color: rgba(255,255,255,0.85); }
.spoiler-chip.chip-W { border-left: 4px solid #f5f0d8; }
.spoiler-chip.chip-U { border-left: 4px solid #2a7de1; }
.spoiler-chip.chip-B { border-left: 4px solid #7a6a9b; }
.spoiler-chip.chip-R { border-left: 4px solid #d3202a; }
.spoiler-chip.chip-G { border-left: 4px solid #00953f; }
.spoiler-chip.chip-C { border-left: 4px solid #b0b0b0; }
.spoiler-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px; margin-top: 12px;
}
.spoiler-card { margin: 0; }
.spoiler-img {
  width: 100%; border-radius: 4.75% / 3.5%; display: block; cursor: zoom-in;
  background: var(--panel); aspect-ratio: 488 / 680;
}
.spoiler-noimg {
  width: 100%; aspect-ratio: 488 / 680; border: 1px dashed var(--border); border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center; padding: 8px; font-size: 0.85rem; color: var(--text);
}
.spoiler-card figcaption { margin-top: 6px; display: flex; flex-direction: column; line-height: 1.25; }
.spoiler-name { font-size: 0.85rem; font-weight: 600; }
.spoiler-meta { font-size: 0.78rem; }
.spoiler-lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 9999;
  display: flex; align-items: center; justify-content: center; cursor: zoom-out; padding: 20px;
}
.spoiler-lightbox img { max-width: min(420px, 92vw); max-height: 92vh; border-radius: 12px; }
@media (max-width: 700px) {
  .spoiler-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
}

/* ---- Article persona picker (Mon R30) ---- */
.persona-picker {
  border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin: 6px 0 12px;
}
.persona-picker legend { font-weight: 600; padding: 0 6px; }
.persona-option {
  display: flex; gap: 10px; align-items: flex-start; padding: 8px 0;
  border-top: 1px solid var(--border);
}
.persona-option:first-of-type { border-top: none; }
.persona-option input[type="checkbox"] { margin-top: 4px; flex: 0 0 auto; }
.persona-option > span { flex: 1; line-height: 1.35; }
.persona-stage {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em;
  border: 1px solid var(--border); border-radius: 10px; padding: 1px 7px; margin-left: 6px;
  color: var(--muted);
}
.persona-voice { margin-top: 6px; max-width: 320px; width: 100%; }
.persona-voice:disabled { opacity: 0.45; }

/* ---- Pager (Mon R31: big locations paginate so pages stay light) ---- */
.pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px; margin: 14px 0 4px;
}
.pager a {
  border: 1px solid var(--border); border-radius: 6px; padding: 6px 12px;
  text-decoration: none; white-space: nowrap;
}
.pager a:hover { background: var(--border); }
.pager-info { padding: 0 6px; color: var(--muted); }
.pager-note { text-align: center; font-size: 0.85rem; margin-top: 2px; }

/* ---- Article angle presets (Mon R31) ---- */
.preset-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.preset-btn {
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px;
  background: transparent; cursor: pointer; font-size: 0.85rem;
}
.preset-btn:hover { background: var(--border); }
.preset-btn.is-active { background: var(--accent, #c8102e); color: #fff; border-color: transparent; }

/* ---- Typography specimen picker (Mon R31) ---- */
.type-specimens { display: grid; gap: 16px; margin-top: 16px; }
@media (min-width: 900px) { .type-specimens { grid-template-columns: 1fr 1fr; } }
.type-specimen {
  border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px;
  background: var(--card, transparent);
}
.type-specimen.is-current { border-color: var(--accent, #c8102e); border-width: 2px; }
.type-specimen-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  margin-bottom: 6px;
}
.type-specimen-note { font-size: 0.78rem; }
.type-badge {
  background: var(--accent, #c8102e); color: #fff; border-radius: 999px;
  padding: 3px 11px; font-size: 0.72rem; white-space: nowrap; letter-spacing: 0.03em;
}
.type-sample {
  border-top: 1px solid var(--border); margin-top: 10px; padding-top: 12px;
}
.type-sample h3 { margin: 0 0 6px; }
.type-sample p { font-size: 0.9rem; margin: 0 0 12px; }
.type-sample-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 7px 0; border-top: 1px solid var(--border); font-size: 0.88rem;
}
.type-sample-set { color: var(--muted); }
.type-sample-row .money { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Category / Product on the Mark Sold forms (Mon R33). Free-text backed by a
   shared <datalist>, so staff can pick from the register's real lists but a
   new one-off value is still typeable rather than blocked. */
.sale-taxo { display: block; width: 100%; margin-top: 6px; font-size: 0.82rem;
  padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px;
  font-family: inherit; background: var(--panel); color: var(--ink); }

/* Cart line: the unit price only shows when qty > 1, so it says something the
   line total doesn't (Mon R37 -- at qty 1 the same peso figure printed twice). */
.cart-each { font-size: 0.75rem; }
