/* ==========================================================================
   Holiday Bonus — shared stylesheet.

   The design tokens below are the single source of truth for the whole app.
   The board form links this file for them and keeps only its own page-specific
   rules inline, so spruce is defined in exactly one place.

   Everything after the tokens is the INTERNAL surface: RD dashboard, admin
   pages, forms. Deliberately denser and plainer than the board form — that
   page is persuading a volunteer once, these are worked in daily through
   November by people doing a job. Tighter rows, smaller type, more on screen.

   Target: laptop at 1366px. Degrades to narrower without breaking.
   No framework, no build step.
   ========================================================================== */

:root {
  /* Palette — shared with the board form */
  --spruce: #1E4034;
  --spruce-deep: #13291F;
  --spruce-line: #2F5647;
  --brass: #A8823C;
  --brass-soft: #C9A35E;
  --oat: #F2EFE8;
  --card: #FFFFFF;
  --ink: #1A241F;
  --ink-soft: #5A655F;
  --rule: #DFD9CC;
  --alert: #8C3A2B;
  --alert-bg: #FBF0ED;
  --radius-card: 6px;
  --radius-field: 4px;

  /* Internal-only additions */
  --ok: #2C6E49;
  --ok-bg: #EAF3ED;
  --warn: #8A5A00;
  --warn-bg: #FBF2E0;
  --info: #2A5567;
  --info-bg: #ECF2F5;
  --page: #F7F5F0;
  --field-bg: #FCFBF8;
  --field-border: #C9C2B2;
  --shadow: 0 1px 2px rgba(26, 36, 31, .06);

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.5;
}

/* ---------------------------------------------------------------- topbar --
   Spruce band and brass rule, same as the board form's masthead, so an RD
   moving between the two sees one application. */
.topbar { background: var(--spruce); color: #F6F3EC; }
.topbar-inner {
  max-width: 1320px; margin: 0 auto; padding: 13px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
/* The mark carries "GRS Community Management", so the text beside it is the
   application name only — repeating the company under it said it twice.

   GRS_Logo_Email.png is the same file the board invitations carry, flattened
   onto #1E4034 for mail clients that composite alpha against white. The
   topbar is that same spruce, so the flattened ground is invisible here. If
   --spruce changes, regenerate the file; a test asserts the two match. */
.brand { display: flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; }
.brand-logo { height: 23px; width: auto; display: block; }
.brand-app {
  padding-left: 13px; border-left: 1px solid var(--spruce-line);
  font-family: var(--serif); font-size: 16px; font-weight: 600; letter-spacing: .01em;
}
.brand:hover .brand-app { color: var(--brass-soft); }
.whoami { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.whoami .name { color: #F6F3EC; }
.whoami .role { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11px; background: var(--spruce-line); color: #D9E6DD; }
.whoami form { margin: 0; }
.linkish {
  background: none; border: none; padding: 0; font: inherit; cursor: pointer;
  color: var(--brass-soft); text-decoration: underline; text-underline-offset: 2px;
}
.linkish:hover { color: #E3C687; }
.brass-rule { height: 3px; background: linear-gradient(90deg, var(--brass) 0%, var(--brass-soft) 55%, var(--spruce-line) 100%); }

/* ------------------------------------------------------------------- nav -- */
.nav { background: var(--card); border-bottom: 1px solid var(--rule); }
.nav-inner { max-width: 1320px; margin: 0 auto; padding: 0 22px; display: flex; flex-wrap: wrap; gap: 2px; }
.nav a {
  display: block; padding: 11px 13px; font-size: 13.5px; color: var(--ink-soft);
  text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap;
}
.nav a:hover { color: var(--ink); background: var(--oat); }
.nav a.on { color: var(--spruce); border-bottom-color: var(--brass); font-weight: 600; }
.nav .sep { flex: 1; }

/* ------------------------------------------------------------------ page -- */
.wrap { max-width: 1320px; margin: 0 auto; padding: 22px 22px 70px; }
h1 { font-family: var(--serif); font-size: 25px; font-weight: 500; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-family: var(--serif); font-size: 18px; font-weight: 500; margin: 30px 0 10px; }
h3 { font-family: var(--serif); font-size: 15.5px; font-weight: 600; margin: 0 0 6px; }
.lede { color: var(--ink-soft); margin: 0 0 20px; max-width: 78ch; }
.muted { color: var(--ink-soft); }
.small { font-size: 12.5px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
a { color: var(--spruce); }
.crumb { font-size: 13px; margin: 0 0 10px; }

/* ----------------------------------------------------------------- cards --
   Stat tiles, matching the upload report's existing shape. */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 11px; margin: 0 0 22px; }
.stat {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-card);
  padding: 13px 15px; box-shadow: var(--shadow); border-top: 3px solid var(--rule);
}
.stat dt { font-size: 11.5px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; margin: 0; }
.stat dd { margin: 5px 0 0; font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1; }
.stat.is-warn { border-top-color: var(--brass); }
.stat.is-warn dd { color: var(--warn); }
.stat.is-info { border-top-color: var(--info); }
.stat.is-ok { border-top-color: var(--ok); }
.stat.is-ok dd { color: var(--ok); }
.stat.is-alert { border-top-color: var(--alert); }
.stat.is-alert dd { color: var(--alert); }
.stat a { text-decoration: none; color: inherit; display: block; }
.stat a:hover dd { text-decoration: underline; }

/* ----------------------------------------------------------------- panel -- */
.panel {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-card);
  box-shadow: var(--shadow); margin: 0 0 20px;
}
.panel-head {
  padding: 12px 16px; border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.panel-head h2 { margin: 0; font-size: 16px; }
.panel-body { padding: 16px; }

/* ---------------------------------------------------------------- notices --
   Flash messages and inline errors share one visual language, so nothing in
   the app ever falls back to a browser default. */
.notice {
  border: 1px solid var(--rule); border-left: 4px solid var(--ink-soft);
  border-radius: var(--radius-field); padding: 12px 15px; margin: 0 0 14px;
  background: var(--card); font-size: 14px;
}
.notice strong { font-weight: 600; }
.notice ul { margin: 7px 0 0; padding-left: 20px; }
.notice li { margin-bottom: 3px; }
.notice.ok { border-left-color: var(--ok); background: var(--ok-bg); color: #1D4A31; }
.notice.warn { border-left-color: var(--brass); background: var(--warn-bg); color: #6E4A08; }
.notice.error { border-left-color: var(--alert); background: var(--alert-bg); color: #6E2C20; }
.notice.info { border-left-color: var(--info); background: var(--info-bg); color: #244756; }
.field-error { color: var(--alert); font-size: 12.5px; margin: 4px 0 0; }

/* ---------------------------------------------------------------- status --
   Four dashboard states, distinguished by colour AND a leading dot, so they
   are not telling apart by hue alone. */
.pill {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 2px 9px 2px 7px; border-radius: 99px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--rule); background: var(--card); color: var(--ink-soft);
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pill.awaiting { color: #6E4A08; background: var(--warn-bg); border-color: #E3CDA0; }
.pill.notsent { color: var(--ink-soft); background: var(--oat); border-color: var(--rule); }
.pill.waiting { color: #244756; background: var(--info-bg); border-color: #BFD3DC; }
.pill.done { color: #1D4A31; background: var(--ok-bg); border-color: #B7D5C2; }
.pill.held { color: #6E2C20; background: var(--alert-bg); border-color: #E2C3BB; }
/* Rides beside Approved, never instead of it: the bonus is approved and
   payroll has it either way. This only says a large amount is in there. */
.pill.over { color: #6E4A08; background: var(--warn-bg); border-color: var(--brass); }
/* A link exists but the app did not deliver it. Distinct from 'awaiting
   board', which means the app did send and is waiting. */
.pill.manual { color: #5A4A1F; background: #F6F1E3; border-color: #D8C9A3; }
.pill.flat { border-style: dashed; }
.pill.flat::before { display: none; }

/* ----------------------------------------------------------------- table --
   Built for 273 rows: the header stays put, rows are tight, and the body
   scrolls inside the panel rather than the page. */
.table-tools {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--rule); background: var(--oat);
}
.table-tools input[type="search"] {
  flex: 0 1 300px; padding: 7px 10px; font: inherit; font-size: 13.5px;
  border: 1px solid var(--field-border); border-radius: var(--radius-field); background: var(--card); color: var(--ink);
}
.table-tools .count { font-size: 12.5px; color: var(--ink-soft); }
.table-scroll { max-height: 66vh; overflow: auto; }
table.grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; }
table.grid th, table.grid td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.grid thead th {
  position: sticky; top: 0; z-index: 2; background: var(--card);
  font-size: 11px; font-weight: 600; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
  border-bottom: 2px solid var(--rule);
}
table.grid tbody tr:hover { background: #FBFAF6; }
table.grid tbody tr:last-child td { border-bottom: none; }
table.grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid td.nowrap, table.grid th.nowrap { white-space: nowrap; }

th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
th.sortable::after { content: "\2195"; opacity: .3; margin-left: 5px; font-size: 10px; }
th.sortable.asc::after { content: "\2191"; opacity: .9; color: var(--brass); }
th.sortable.desc::after { content: "\2193"; opacity: .9; color: var(--brass); }

tr.is-hidden { display: none; }
.empty { color: var(--ink-soft); padding: 26px 16px; }
.empty-row td { color: var(--ink-soft); padding: 26px 16px; text-align: center; }

/* ----------------------------------------------------------------- forms -- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
label.inline { display: inline-flex; align-items: center; gap: 7px; font-weight: 400; margin: 0; }
.field { margin: 0 0 14px; }
.field .hint { font-size: 12.5px; color: var(--ink-soft); margin: 4px 0 0; font-weight: 400; }
input[type="text"], input[type="email"], input[type="password"],
input[type="search"], input[type="tel"], select, textarea {
  font: inherit; font-size: 14px; color: var(--ink); width: 100%;
  background: var(--field-bg); border: 1px solid var(--field-border);
  border-radius: var(--radius-field); padding: 8px 10px;
}
textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
input[type="file"] { font: inherit; font-size: 13.5px; padding: 7px 0; }
select {
  appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%235A655F' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 10px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible,
button:focus-visible, a:focus-visible {
  outline: 2.5px solid var(--brass); outline-offset: 2px;
}
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1 1 220px; }

button, .btn {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  padding: 8px 16px; border-radius: var(--radius-field);
  border: 1px solid var(--spruce); background: var(--spruce); color: #F6F3EC;
  text-decoration: none; display: inline-block; line-height: 1.4;
}
button:hover, .btn:hover { background: var(--spruce-deep); border-color: var(--spruce-deep); }
button.secondary, .btn.secondary { background: var(--card); color: var(--spruce); border-color: var(--field-border); }
button.secondary:hover, .btn.secondary:hover { background: var(--oat); border-color: var(--ink-soft); }
button.danger, .btn.danger { background: var(--card); color: var(--alert); border-color: #E2C3BB; }
button.danger:hover, .btn.danger:hover { background: var(--alert-bg); border-color: var(--alert); }
button.small, .btn.small { font-size: 12.5px; padding: 4px 10px; font-weight: 500; }
/* Row actions sit on white table rows, where .secondary's white fill and
   faint border read as nothing at all. Oat fill and a spruce edge make the
   action visibly an action without 44 solid buttons shouting down a page. */
.btn.row-action {
  font-size: 12.5px; font-weight: 600; padding: 4px 11px;
  background: var(--oat); color: var(--spruce); border-color: #C3BBA6;
}
.btn.row-action:hover { background: var(--spruce); color: #F6F3EC; border-color: var(--spruce); }
/* The blocking ones — nothing can go out until they are dealt with. */
.btn.row-action.needs { background: var(--warn-bg); color: #6E4A08; border-color: var(--brass); }
.btn.row-action.needs:hover { background: var(--brass); color: #22180A; border-color: var(--brass); }
button:disabled { background: #9B978D; border-color: #9B978D; color: #E8E5DE; cursor: not-allowed; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions form { margin: 0; }

/* ------------------------------------------------------- sign-in split --
   Full-viewport two-panel sign-in. The art panel bleeds to the page edges and
   crops rather than letterboxing; the text panel centres its content and caps
   its measure so it does not sprawl across a wide monitor.

   Spruce on the text side: it carries the brand, and a dark panel holds its
   own beside a photograph where oat would go muddy against a busy image. To
   try the lighter treatment instead, add class="light" to .split-form. */
.split-page { margin: 0; background: var(--spruce); }

/* The sign-in page is exactly one screen and never scrolls. Scoped to the
   class on this page's own <html>, so no other page is locked. */
html.split-lock,
html.split-lock body { height: 100%; overflow: hidden; }

/* A definite height, not min-height: the art panel has to know its height
   before the video's height: 100% means anything. With only a min-height the
   video fell back to its intrinsic 3:4 size, taller than the screen, and the
   page scrolled. 100dvh tracks mobile browser chrome; 100vh is the fallback. */
.split { display: flex; height: 100vh; height: 100dvh; }

.split-art {
  flex: 1 1 50%;
  min-width: 0; min-height: 0;
  position: relative;
  overflow: hidden;
  background: var(--spruce-deep);
}
/* Absolutely positioned so the media's own dimensions can never size the
   panel: it is laid out to the panel's box and cropped into it. */
.split-art picture,
.split-art img,
.split-art video {
  position: absolute; inset: 0;
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  /* Anchored left: the panel is taller than the image is proportionally wide,
     so cover crops horizontally. Centred, it took half the overage off each
     side and cut into "Holiday" and Santa. Anchored left, the whole crop comes
     off the right, which is falling money and loses nothing. */
  object-position: left center;
}
/* The still is only for prefers-reduced-motion; a looping animation behind a
   sign-in form is what that setting exists to switch off. */
.split-art .split-art-still { display: none; }
@media (prefers-reduced-motion: reduce) {
  .split-art .split-art-motion { display: none; }
  .split-art .split-art-still { display: block; }
}

/* The one part of this page that may scroll: when the form does not fit (a
   phone in landscape), the sign-in button must stay reachable. Centred with
   auto margins on the inner block, not align-items: center — in a scrolling
   flex container that pushes the overflow above the top edge, out of reach. */
.split-form {
  flex: 1 1 50%;
  min-width: 0; min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  padding: 7vh 6vw;
  background: var(--spruce);
  color: #F1EDE4;
}
.split-form > .split-form-inner { margin: auto; }
/* Caps the measure so the text does not stretch on a wide screen. */
.split-form-inner { width: 100%; max-width: 420px; }

/* The GRS logo: white artwork on transparency, sized by height. The file is
   3023x549, so even a 3x screen has several times the pixels it needs. */
.split-logo {
  display: block;
  height: 44px; width: auto; max-width: 100%;
  /* If a very narrow panel caps the width, shrink rather than squash. */
  object-fit: contain; object-position: left center;
  margin: 0 0 30px;
}

.split-form h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 3.4vw, 42px);
  font-weight: 500; line-height: 1.12; letter-spacing: -.01em;
  margin: 0 0 14px; color: #F6F3EC;
}
.split-lede {
  margin: 0 0 28px; font-size: 16px; line-height: 1.55;
  color: rgba(241, 237, 228, .8);
}
.split-note {
  margin: 22px 0 0; font-size: 13px; line-height: 1.55;
  color: rgba(241, 237, 228, .55);
}
.split-note a { color: var(--brass-soft); }

.btn-brass {
  background: var(--brass); border-color: var(--brass); color: #22180A;
  font-size: 15.5px; padding: 12px 24px;
}
.btn-brass:hover { background: var(--brass-soft); border-color: var(--brass-soft); }

/* The lighter alternative, if the photo reads better against oat. Unused.
   The logo is white artwork and would vanish on oat: switching to this needs
   a dark export of the logo, not just this class. */
.split-form.light { background: var(--oat); color: var(--ink); }
.split-form.light h1 { color: var(--ink); }
.split-form.light .split-lede { color: var(--ink-soft); }
.split-form.light .split-note { color: var(--ink-soft); }
.split-form.light .split-note a { color: var(--spruce); }

/* Stacked: still one screen. The form takes the height its content needs and
   the art takes whatever is left, covering it at any height. If the form needs
   more than the screen, it shrinks to fit and scrolls; the art goes to zero. */
@media (max-width: 800px) {
  .split { flex-direction: column; }
  .split-art { flex: 1 1 0; }
  .split-form { flex: 0 1 auto; padding: 32px 24px 40px; }
  .split-form-inner { max-width: 460px; }
}

.copyable { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.copyable pre.block { flex: 1 1 320px; margin: 0; word-break: break-all; }
.copyable button { flex: 0 0 auto; }
button[data-copy].copied { background: var(--ok-bg); color: #1D4A31; border-color: var(--ok); }

pre.block {
  background: var(--oat); border: 1px solid var(--rule); border-radius: var(--radius-field);
  padding: 13px 15px; white-space: pre-wrap; font-size: 13px; line-height: 1.5; margin: 0;
  font-family: var(--sans);
}

@media (max-width: 900px) {
  .topbar-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .table-scroll { max-height: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* The formatted invitation shown on the sent/prepare pages for an RD to copy.
   Everything inside is inline-styled email HTML, so nothing here reaches into
   it — this only frames the card and keeps a 600px table from forcing the page
   wider on a laptop screen. */
.paste-card {
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #F2EFE8;
  padding: 16px;
  overflow-x: auto;
}
.paste-card h1 { font-weight: normal; letter-spacing: 0; }


/* Merge-field chips: a wrapping row of small buttons under the message box. */
.merge-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.merge-fields .merge-field {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}


/* Roster reordering. The grip is the affordance; the arrows are the fallback
   for touch and keyboard, where HTML5 drag does not reach. */
table.reorderable tr[draggable="true"] { cursor: grab; }
table.reorderable tr.dragging { opacity: .45; }
table.reorderable .handle { white-space: nowrap; }
table.reorderable .grip { color: var(--ink-soft, #5A655F); margin-right: 6px; cursor: grab; }
table.reorderable .move-up,
table.reorderable .move-down { padding: 2px 7px; line-height: 1; }


/* The bulk-send bar, pinned under the community table once something is
   picked. Hidden at rest so the dashboard does not open with Send looming. */
.bulk-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  margin-top: 10px;
  border-top: 1px solid var(--rule, #DFD9CC);
  background: var(--paper, #FBF9F4);
}
