/* Reports — the generate form and the list of spreadsheets already made.
   Sorts after 66_expenses, since a report is read against the spending it
   summarises, and before 70_print. Nothing here carries a colour of its own:
   the accent tokens 50_admin.css defines are what it reads. */

/* The question above the fold: which month, dated how, in what order, and go.
   The month grid takes the left, everything else stacks beside it. */
.rp-ask {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(220px, 1fr);
  gap: 20px;
  align-items: start;
}

.rp-ask__rest {
  display: grid;
  gap: 14px;
  align-content: start;
}

.rp-ask__go .a-btn { width: 100%; }

/* The month picker. A year select over twelve chips, which are radios wearing
   a label — so the whole thing submits with no JavaScript. */
.rp-month {
  border: 1px solid var(--a-line);
  border-radius: 10px;
  padding: 10px 14px 14px;
  margin: 0;
  min-width: 0;
}

.rp-month > legend {
  font-size: 13px;
  font-weight: 600;
  padding: 0 6px;
}

.rp-month__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.rp-month__yearlabel {
  font-size: 13px;
  font-weight: 600;
}

.rp-month__head select {
  flex: 1;
  max-width: 130px;
  padding: 7px 10px;
  border: 1px solid var(--a-line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  color: inherit;
}

.rp-month__head select:focus {
  outline: 2px solid var(--a-accent);
  outline-offset: 1px;
}

.rp-month__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.rp-month__cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--a-line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

/* The radio is the control and the chip is its face: kept reachable by a
   keyboard and by a screen reader rather than hidden outright. */
.rp-month__cell input[type="radio"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: inherit;
}

.rp-month__name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}

.rp-month__cell:hover { border-color: var(--a-accent); }

.rp-month__cell:has(input:checked) {
  background: var(--a-accent);
  border-color: var(--a-accent);
  color: #fff;
}

.rp-month__cell:has(input:focus-visible) {
  outline: 2px solid var(--a-accent-d);
  outline-offset: 2px;
}

/* A month nobody has reached yet. Dimmed rather than removed, so the grid is
   always twelve cells and the year reads the same shape every time. */
.rp-month__cell.is-ahead {
  background: var(--a-soft);
  border-color: transparent;
  color: var(--a-muted);
  opacity: 0.55;
  cursor: not-allowed;
}

.rp-month__cell.is-ahead:hover { border-color: transparent; }

/* How many reports this month already has — so a third is a decision. */
.rp-month__made {
  position: absolute;
  top: -6px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--a-accent-d);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}

.rp-month__made[hidden] { display: none; }

.rp-month__cell:has(input:checked) .rp-month__made {
  background: #fff;
  color: var(--a-accent-d);
}

/* The period picker, for a kind that takes a day or a range as well as a
   month (the GCash report). Three tabs over three panels; the chosen tab's
   panel is the only one shown, and the month grid inside it drops its own
   frame, since it already sits in this one. */
.rp-span {
  border: 1px solid var(--a-line);
  border-radius: 10px;
  padding: 10px 14px 14px;
  margin: 0;
  min-width: 0;
}

.rp-span > legend {
  font-size: 13px;
  font-weight: 600;
  padding: 0 6px;
}

.rp-span__tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 3px;
  margin-bottom: 12px;
  border-radius: 9px;
  background: var(--a-soft);
}

.rp-span__tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.rp-span__tab input[type="radio"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: inherit;
}

.rp-span__tab:has(input:checked) {
  background: var(--a-accent);
  color: #fff;
}

.rp-span__tab:has(input:focus-visible) {
  outline: 2px solid var(--a-accent-d);
  outline-offset: 1px;
}

.rp-span:has(.rp-span__tab input:checked) .rp-span__panel { display: none; }
.rp-span:has(#span_day:checked) .rp-span__panel--day,
.rp-span:has(#span_month:checked) .rp-span__panel--month,
.rp-span:has(#span_range:checked) .rp-span__panel--range { display: block; }

.rp-span .rp-month {
  border: 0;
  padding: 0;
}

.rp-span .rp-month > legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.rp-span__range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.rp-span__panel .hint,
.rp-hint {
  display: block;
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--a-muted);
}

.rp-hint { margin: 0; }

.rp-more {
  margin-top: 18px;
  border-top: 1px solid var(--a-line);
  padding-top: 14px;
}

.rp-more > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--a-accent-d);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 2px;
}

.rp-more > summary::-webkit-details-marker { display: none; }

.rp-more > summary::before {
  content: "›";
  font-size: 17px;
  line-height: 1;
  transition: transform 0.14s ease;
}

.rp-more[open] > summary::before { transform: rotate(90deg); }

.rp-more > summary:focus-visible {
  outline: 2px solid var(--a-accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.rp-more__body {
  display: grid;
  gap: 18px;
  padding: 16px 0 4px;
}

/* The three switches read as a list of sentences, not as a row of boxes: each
   carries a consequence underneath it. */
.rp-switches {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  background: var(--a-soft);
  border-radius: 10px;
}

.rp-switches .a-field--check { gap: 2px; }
.rp-switches .a-field--check label { align-items: flex-start; }
.rp-switches .a-field--check .hint { flex-basis: 100%; margin-left: 25px; }

.rp-columns {
  border: 1px solid var(--a-line);
  border-radius: 10px;
  padding: 12px 16px 14px;
  margin: 0;
}

.rp-columns > legend {
  font-size: 13px;
  font-weight: 600;
  padding: 0 6px;
}

.rp-columns__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px 18px;
  margin-bottom: 10px;
}

.rp-columns__grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  min-width: 0;
}

.rp-columns__grid input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--a-accent);
  flex: none;
}

/* What a report was asked for, so two reports on the same month are told
   apart at a glance. */
.rp-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.rp-pill {
  font-size: 11.5px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--a-soft);
  color: var(--a-accent-d);
  white-space: nowrap;
}

.rp-file {
  display: block;
  font-size: 12px;
}

@media (max-width: 720px) {
  .rp-ask { grid-template-columns: 1fr; }
}

/* ── Daily Operations ──────────────────────────────────────────────────────
   One day of the shop in seven numbered panels, in the order the owner asked
   for them. Everything leans on the admin's own tokens, so Settings →
   Appearance recolours it with the rest of /admin. */
.dr-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dr-head h1 .a-pill { font-size: 12px; letter-spacing: .3px; }
.dr-export { display: flex; flex-direction: column; gap: 4px; align-self: center; }
.dr-export__label { font-size: 12px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase; color: var(--a-muted); }
.dr-export__buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.fm-analysis-run { display: contents; }
.dr-export .a-btn svg { width: 18px; height: 18px; flex: none; }
.dr-export__schedule { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--a-accent-d); }
.dr-export__schedule svg { width: 15px; height: 15px; }
.dr-open { margin: -6px 0 14px; }

.dr-stats .a-stat__value small.dr-stat__sub { font-size: 13px; font-weight: 600; color: var(--a-muted); }

.dr-section { scroll-margin-top: 80px; }
.dr-num {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; margin-right: 6px;
  border-radius: 50%;
  background: var(--a-accent); color: #fff;
  font-size: 12px; font-weight: 700; vertical-align: 1px;
}

.dr-subhead { font-size: 14px; font-weight: 700; margin: 18px 0 8px; display: flex; align-items: center; gap: 8px; }
.dr-subhead small { font-weight: 500; color: var(--a-muted); font-size: 12.5px; }
.dr-cash__col > .dr-subhead:first-child,
.dr-remarks > div > .dr-subhead:first-child { margin-top: 0; }

.dr-foot { margin: 12px 0 0; font-size: 13.5px; color: var(--a-muted); }
.dr-foot strong { color: var(--a-ink); }

/* The status and payment mix as a line of chips over the table. */
.dr-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.dr-chip {
  font-size: 13px; padding: 5px 10px; border-radius: 999px;
  background: #F1F4F3; color: var(--a-ink); white-space: nowrap;
}
.dr-chip--money { background: var(--a-soft); color: var(--a-accent-d); }
.dr-chip small { color: var(--a-muted); }

.dr-table td, .dr-table th { font-size: 13.5px; }
.dr-table tfoot td { border-top: 1px solid var(--a-line); }
.dr-subtotal td { color: var(--a-muted); padding-top: 4px; padding-bottom: 4px; }
.dr-total td { font-weight: 700; }

/* GCash and others: each payment beside its screenshot, so checking one
   against the other is a glance rather than a click. */
.dr-proofs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px;
             grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.dr-proof {
  display: flex; gap: 12px; align-items: center;
  border: 1px solid var(--a-line); border-radius: 10px; padding: 8px;
}
.dr-proof.is-missing { border-color: var(--a-bad); background: var(--a-bad-bg); }
.dr-proof__shot {
  flex: none; width: 72px; height: 72px; border-radius: 6px; overflow: hidden;
  display: grid; place-items: center; background: #F1F4F3;
}
.dr-proof__shot img { width: 100%; height: 100%; object-fit: cover; }
.dr-proof__shot--none { font-size: 11.5px; font-weight: 600; text-align: center; color: var(--a-bad); background: #fff; }
.dr-proof__text { display: grid; gap: 1px; font-size: 13.5px; min-width: 0; }
.dr-proof__amount { font-size: 15px; }

/* The envelope and the fund side by side, as on the log book's day page. */
.dr-cash { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }

.dr-issues .t-finding { font-size: 14px; }
.dr-issues__open { margin-left: auto; font-size: 13px; font-weight: 600; }
.dr-notes { margin-top: 18px; }
.dr-notes textarea { width: 100%; }

/* When the remarks write themselves: one row under them, ruled off. */
.dr-auto {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--a-line);
}
.dr-auto__check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; margin: 0; }
.dr-auto input[type="time"] { width: auto; }
.dr-auto__hint { flex-basis: 100%; margin: 0; }
.dr-summary { font-size: 15.5px; line-height: 1.55; margin: 0 0 14px; }
.dr-remarks { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.dr-remarks ul, .dr-remarks ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.dr-remarks .t-findings { padding-left: 0; margin-top: 0; }

.dr-caution { font-size: 12.5px; color: var(--a-muted); margin: 4px 0 24px; }

@media (max-width: 720px) {
  .dr-cash { grid-template-columns: 1fr; gap: 10px; }
  .dr-export { width: 100%; }
  .dr-export .a-btn { flex: 1; justify-content: center; }
}

/* ── Full Monthly Report ───────────────────────────────────────────────────
   The Daily Operations layout (.dr-*) for a month, in the report's own blue
   (#1F4E79, which its PDF and Excel file wear too) rather than the admin
   theme: the section numbers, the figures' rules and the charts. */
.fm { --fm-brand: #1F4E79; --fm-soft: #EAF0F6; --fm-good: #1B7A4A; --fm-bad: #B3412F; }
.fm .dr-num { background: var(--fm-brand); }
.fm .a-panel__title { color: var(--fm-brand); }
.fm .dr-table thead th { color: var(--fm-brand); }

.fm-cover { display: flex; flex-wrap: wrap; gap: 6px 28px; padding: 12px 16px; margin: 0 0 14px; }
.fm-cover > div { display: grid; gap: 1px; }
.fm-cover dt { font-size: 11.5px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase; color: var(--a-muted); }
.fm-cover dd { margin: 0; font-size: 14px; font-weight: 600; }

.fm-bullets { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 7px; font-size: 14.5px; line-height: 1.5; }
.fm-commentary { margin: 0 0 14px; font-size: 14.5px; line-height: 1.55; }

.fm-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.fm-kpi { border: 1px solid var(--a-line); border-top: 3px solid var(--fm-brand); border-radius: 8px; padding: 10px 12px; background: #fff; }
.fm-kpi__label { font-size: 12px; font-weight: 600; color: var(--a-muted); }
.fm-kpi__value { font-size: 20px; font-weight: 700; margin: 2px 0; font-variant-numeric: tabular-nums; }
.fm-kpi__change { font-size: 12.5px; }

.fm-change { white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
.fm-change--good { color: var(--fm-good); }
.fm-change--bad { color: var(--fm-bad); }
.fm-change--flat, .fm-change--none { color: var(--a-muted); font-weight: 500; }
.fm-change--neutral { color: var(--a-ink); }

.fm-ladder__result td { font-weight: 700; border-top: 1px solid var(--a-line); background: var(--fm-soft); }
.fm-ladder__percent td { color: var(--a-muted); font-size: 12.5px; }

.fm-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 20px; margin: 0 0 6px; }
.fm-facts > div { display: grid; gap: 1px; }
.fm-facts dt { font-size: 12px; font-weight: 600; color: var(--a-muted); }
.fm-facts dd { margin: 0; font-size: 14px; font-weight: 600; }
.fm-facts dd small { font-weight: 500; color: var(--a-muted); }

.fm-chips { margin: 14px 0 0; }
.fm-details { margin-top: 16px; }
.fm-details summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--fm-brand); }
.fm-details .a-table-wrap { margin-top: 10px; }

.fm-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.fm-list { margin: 0; padding-left: 20px; display: grid; gap: 7px; font-size: 14px; }

.fm-recs { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: rec; }
.fm-rec { border: 1px solid var(--a-line); border-left: 4px solid var(--fm-brand); border-radius: 8px; padding: 12px 14px; }
.fm-rec__head { display: flex; gap: 8px; align-items: baseline; font-size: 14.5px; margin-bottom: 8px; }
.fm-rec dl { margin: 0; display: grid; gap: 4px; }
.fm-rec dl > div { display: grid; grid-template-columns: 130px 1fr; gap: 10px; font-size: 13.5px; }
.fm-rec dt { color: var(--a-muted); font-weight: 600; }
.fm-rec dd { margin: 0; }
.fm-priority--high { background: #FBE5E1; color: var(--fm-bad); }
.fm-priority--medium { background: #FCF0DA; color: #7A5410; }
.fm-priority--low { background: var(--fm-soft); color: var(--fm-brand); }

.fm-charts { display: grid; gap: 28px; }
.fm-charts figure { margin: 0; }
.fm-charts figcaption { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.fm-charts figcaption small { font-weight: 500; color: var(--a-muted); margin-left: 6px; }
.fm-chart { display: block; width: 100%; height: auto; max-width: 860px; }
.fm-chart-table { margin-top: 10px; max-width: 640px; }

.fm-formulas { margin: 0; display: grid; gap: 4px; }
.fm-formulas > div { display: grid; grid-template-columns: 260px 1fr; gap: 12px; font-size: 13.5px; }
.fm-formulas dt { font-weight: 600; }
.fm-formulas dd { margin: 0; color: var(--a-muted); }

.fm-notes-insight { border-left: 3px solid var(--fm-brand); padding: 2px 0 2px 14px; margin: 0 0 12px; }
.fm-notes-insight .fm-commentary { margin: 0; }
.fm-notes-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* The annexes: Monthly Sales and Monthly Expenses whole. Figures and dates stay
   on one line and the table scrolls sideways; only the long text wraps. */
.fm-annex td, .fm-annex th { white-space: nowrap; }
.fm-annex td.fm-annex__text { white-space: normal; min-width: 180px; }
.fm-annex tr.is-quiet td { color: var(--a-muted); }
.fm-annex-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 24px; margin-top: 16px; }
.fm-annex-summary td.is-sub { padding-left: 26px; }

@media (max-width: 720px) {
  .fm-split { grid-template-columns: 1fr; }
  .fm-rec dl > div, .fm-formulas > div { grid-template-columns: 1fr; gap: 0; }
}

/* ── Ask about this report ─────────────────────────────────────────────────
   A drawer beside the report, not another section under it. On a wide screen
   the page makes room for it, so the report reflows beside the conversation;
   on a phone it is a bottom sheet. Hidden until opened (the `hidden`
   attribute), and every way in is hidden too until the controller connects. */
.fm-ask-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 65;
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px;
  border-radius: 999px; background: var(--fm-brand); color: #fff; font-weight: 600; font-size: 14px;
  text-decoration: none; box-shadow: 0 6px 18px rgba(31, 78, 121, .28);
}
.fm-ask-fab:hover, .fm-ask-fab:focus-visible { background: #173E61; color: #fff; }
.fm-ask-fab[aria-expanded="true"] { display: none; }
/* Room at the foot of the report, so the button never sits on its last row. */
.fm { padding-bottom: 56px; }

.fm-ask-section {
  border: 1px solid transparent; background: none; color: var(--fm-brand); font: inherit; font-size: 13px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; cursor: pointer; opacity: .7;
}
.fm-ask-section:hover, .fm-ask-section:focus-visible { opacity: 1; background: var(--fm-soft); border-color: #C9D7E6; }
.fm-ask-section[hidden] { display: none; }

.fm-ask-chip {
  position: fixed; z-index: 66; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border: 0; border-radius: 999px; background: var(--fm-brand); color: #fff; font: inherit; font-size: 13px;
  font-weight: 600; cursor: pointer; box-shadow: 0 4px 12px rgba(31, 78, 121, .3);
}
.fm-ask-chip[hidden] { display: none; }

.fm-ask {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 70; width: 420px; max-width: 100vw;
  display: flex; flex-direction: column; background: var(--a-bg, #F6F8F8);
  border-left: 1px solid var(--a-line); box-shadow: -10px 0 30px rgba(22, 33, 31, .12);
  animation: fm-ask-in .18s ease-out;
}
.fm-ask[hidden] { display: none; }
@keyframes fm-ask-in { from { transform: translateX(24px); opacity: 0; } }

.fm-ask__head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; background: var(--fm-brand); color: #fff;
}
.fm-ask__head h2 { margin: 0; font-size: 15px; font-weight: 700; }
.fm-ask__close { border: 0; background: none; color: #fff; font-size: 18px; line-height: 1; padding: 4px 6px; cursor: pointer; border-radius: 6px; }
.fm-ask__close:hover, .fm-ask__close:focus-visible { background: rgba(255, 255, 255, .15); }

.fm-ask turbo-frame { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.fm-ask__loading { flex: 1; display: grid; place-items: center; }
.fm-ask__body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.fm-ask__bar {
  display: flex; align-items: center; gap: 12px; padding: 8px 16px; font-size: 12.5px;
  border-bottom: 1px solid var(--a-line); background: var(--a-surface);
}
.fm-ask__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--a-muted); }
.fm-ask__bar a { white-space: nowrap; color: var(--fm-brand); font-weight: 600; }

.fm-ask__thread { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px; display: grid; gap: 10px; align-content: start; }
.fm-ask .as-msg { padding: 10px 12px; font-size: 14px; }
.fm-ask .as-msg--user { background: var(--fm-soft); }
.fm-ask .as-steps { font-size: 12.5px; }

.fm-ask__empty { color: var(--a-ink); font-size: 14px; line-height: 1.5; }
.fm-ask__empty p { margin: 0 0 10px; }
.fm-ask__hint { color: var(--a-muted); font-size: 13px; }
.fm-ask__starters { display: grid; gap: 8px; margin-top: 6px; }
.fm-ask__starter {
  text-align: left; border: 1px solid #C9D7E6; background: var(--a-surface); color: var(--fm-brand);
  font: inherit; font-size: 13.5px; padding: 9px 12px; border-radius: 10px; cursor: pointer;
}
.fm-ask__starter:hover, .fm-ask__starter:focus-visible { background: var(--fm-soft); }

.fm-ask__form { padding: 12px 16px 14px; border-top: 1px solid var(--a-line); background: var(--a-surface); }
.fm-ask__form textarea {
  width: 100%; resize: vertical; min-height: 64px; max-height: 40vh; font: inherit; font-size: 14px;
  padding: 9px 11px; border: 1px solid var(--a-line); border-radius: 8px;
}
.fm-ask__form textarea:focus { outline: 2px solid var(--fm-brand); outline-offset: -1px; }
.fm-ask__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.fm-ask__model { font-size: 12px; color: var(--a-muted); }
.fm-ask__form .a-btn { background: var(--fm-brand); border-color: var(--fm-brand); }

/* Room for the drawer beside the report, where there is room to give. */
@media (min-width: 1100px) {
  body.fm-ask-open { padding-right: 420px; }
}
@media (max-width: 720px) {
  .fm-ask {
    top: auto; width: 100vw; height: 85vh; height: 85dvh; border-left: 0; border-radius: 14px 14px 0 0;
    box-shadow: 0 -10px 30px rgba(22, 33, 31, .18); animation-name: fm-ask-up;
  }
  .fm-ask__head { border-radius: 14px 14px 0 0; }
  .fm-ask-fab { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); }
}
@keyframes fm-ask-up { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .fm-ask { animation: none; }
}
@media print {
  .fm-ask, .fm-ask-fab, .fm-ask-chip, .fm-ask-section { display: none !important; }
}

/* Scheduled Reports (/admin/reports/schedules). The timing tabs borrow the
   period picker's look; which fields show follows the chosen tab, by :has(),
   so the form needs no JavaScript. */
.rs-label { font-size: 13px; font-weight: 600; }
.rs-checks { display: flex; gap: 22px; flex-wrap: wrap; }

.rs-when__fields { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; }
.rs-when__fields .a-field { width: 190px; }
.rs-when:has(input[value="daily"]:checked) :is(.rs-when__day, .rs-when__manual),
.rs-when:has(input[value="monthly"]:checked) .rs-when__manual,
.rs-when:has(input[value="manual"]:checked) :is(.rs-when__day, .rs-when__time) { display: none; }
.rs-when__manual { margin: 0; }
.rs-enabled { margin-top: 14px; }
.rs-option { margin: 16px 0 20px; padding-bottom: 16px; border-bottom: 1px solid var(--a-line); }

.rs-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.rs-person {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "box name pill" "box email pill";
  align-items: center;
  column-gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--a-line);
  border-radius: 9px;
  cursor: pointer;
}
.rs-person:has(input:checked) { border-color: var(--a-accent); background: var(--a-soft); }
.rs-person input { grid-area: box; width: 17px; height: 17px; accent-color: var(--a-accent); }
.rs-person__name { grid-area: name; font-weight: 600; font-size: 14px; }
.rs-person__email { grid-area: email; font-size: 12.5px; color: var(--a-muted); overflow-wrap: anywhere; }
.rs-person .a-pill { grid-area: pill; }

.rs-preview { white-space: pre-wrap; }
.rs-delete { margin-top: 24px; }

.rs-facts { display: grid; gap: 8px; margin: 0 0 14px; }
.rs-facts > div { display: grid; grid-template-columns: 90px 1fr; gap: 10px; }
.rs-facts dt { font-size: 13px; font-weight: 600; color: var(--a-muted); }
.rs-facts dd { margin: 0; }
.rs-facts .hint { color: var(--a-muted); }
.rs-error { margin: 0 0 14px; padding: 9px 12px; border-radius: 8px; background: var(--a-bad-bg); color: var(--a-bad); }

/* A date and the buttons that act on it, one row, every control the same
   height: the buttons are sized to the date field, not the other way round. */
.rs-send { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--a-line); }
.rs-send .a-field { width: 190px; }
.rs-send .a-field input,
.rs-send .a-btn { height: 42px; }
.rs-send .a-btn { padding: 0 16px; justify-content: center; }
.rs-send .a-btn:disabled { opacity: .5; cursor: not-allowed; }

/* The preview: a toolbar, then the message as a mail client draws it — a
   header card over the body, on a grey ground so the white message reads as
   one. */
.rs-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; padding: 14px 18px; }
.rs-toolbar .rs-send { padding-top: 0; border-top: 0; }

.rs-message { border: 1px solid var(--a-line); border-radius: 12px; overflow: hidden; background: #EEF1F0; }
.rs-message__head { padding: 18px 22px 16px; background: #fff; border-bottom: 1px solid var(--a-line); }
.rs-message__subject { margin: 0 0 12px; font-size: 19px; line-height: 1.3; }
.rs-message__headers { display: grid; gap: 4px; margin: 0; font-size: 14px; }
.rs-message__headers > div { display: grid; grid-template-columns: 76px 1fr; gap: 10px; }
.rs-message__headers dt { color: var(--a-muted); font-weight: 600; font-size: 13px; }
.rs-message__headers dd { margin: 0; overflow-wrap: anywhere; }

.rs-files { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 14px 0 0; padding: 0; }
.rs-file {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--a-line); border-radius: 8px;
  color: var(--a-ink); text-decoration: none; font-size: 13.5px;
}
a.rs-file:hover { border-color: var(--a-accent); background: var(--a-soft); }
.rs-file svg { width: 20px; height: 20px; flex: none; color: var(--a-accent); }
.rs-file__name { font-weight: 600; overflow-wrap: anywhere; }
.rs-file__size { color: var(--a-muted); font-size: 12.5px; white-space: nowrap; }

/* email-frame grows this to the message; the height is the no-JS one. */
.rs-message__body { display: block; width: 100%; height: 900px; border: 0; background: #EEF1F0; }

@media (max-width: 600px) {
  .rs-message__head { padding: 16px; }
  .rs-toolbar .rs-send--end, .rs-toolbar .rs-send--end .a-btn { width: 100%; }
}
