/* Signed-in dashboard, stage 2 — records pages (scoped to body.is-dash): Hunt reports
   (views/reports.js, .d-records), a hunt report (views/report.js, .d-report) and a
   blind (views/blind.js, .d-blind). Long lists are paged tables; nothing grows into a
   wall as reports pile up. */

/* Report tables: one line per report; full text sits in each cell's tooltip. They hold
   at most 20 rows, so they never need the shared inner-scroll height cap. */
.is-dash .d-records .d-table-wrap, .is-dash .d-blind .d-table-wrap { max-height: none; }
.is-dash .d-records .d-col-id, .is-dash .d-blind .d-col-id { width: 1%; }
.is-dash .d-records .d-row-id { color: var(--d-text-2); font-weight: 600; }
.is-dash .d-records .d-col-date, .is-dash .d-blind .d-col-date { width: 1%; }
.is-dash .d-records .d-col-season, .is-dash .d-blind .d-col-season { width: 1%; color: var(--d-muted); }
.is-dash .d-records .d-col-type { width: 1%; }
.is-dash .d-records .d-col-blind .d-cell-trunc { max-width: 26ch; }
.is-dash .d-records .d-col-people .d-cell-trunc, .is-dash .d-blind .d-col-people .d-cell-trunc { max-width: 34ch; }
.is-dash .d-records .d-col-species .d-cell-trunc, .is-dash .d-blind .d-col-species .d-cell-trunc { max-width: 30ch; }
.is-dash .d-records .d-col-actions { width: 1%; }
.is-dash .d-records .d-table td.d-col-actions { padding-block: 4px; }
.is-dash :is(.d-records, .d-blind) .d-cell-split { display: inline-flex; align-items: baseline; gap: 4px; }
.is-dash :is(.d-records, .d-blind) .d-cell-more { flex: none; }
.is-dash .d-records .d-row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.is-dash .d-records .d-row-actions .log-action { min-height: 26px; padding: 0 10px; font-size: 12px; }
@media (max-width: 1599.98px) {
  .is-dash .d-records .d-col-blind .d-cell-trunc { max-width: 18ch; }
  .is-dash .d-records .d-col-people .d-cell-trunc, .is-dash .d-blind .d-col-people .d-cell-trunc { max-width: 24ch; }
  .is-dash .d-records .d-col-species .d-cell-trunc, .is-dash .d-blind .d-col-species .d-cell-trunc { max-width: 22ch; }
}
/* Edit / Delete / Restore need room: a table with an Actions column drops Season below
   1680px, Species below 1440px and Hunters below 1100px, so Birds and the actions stay
   inside the panel (on phones the actions column is pinned instead; see below). */
@media (max-width: 1679.98px) { .is-dash .d-records .d-table:has(th.d-col-actions) .d-col-season { display: none; } }
@media (max-width: 1439.98px) { .is-dash .d-records .d-table:has(th.d-col-actions) .d-col-species { display: none; } }
@media (max-width: 1365.98px) {
  .is-dash .d-records .d-col-season, .is-dash .d-blind .d-col-season { display: none; }
  .is-dash .d-records .d-col-people .d-cell-trunc, .is-dash .d-blind .d-col-people .d-cell-trunc { max-width: 18ch; }
  .is-dash .d-records .d-col-species .d-cell-trunc, .is-dash .d-blind .d-col-species .d-cell-trunc { max-width: 16ch; }
}
/* One-column widths (tablets, a narrow window): Season and Species step aside so Birds
   stays in view; phones also drop Hunters (each report's page has them all). */
@media (max-width: 1099.98px) {
  .is-dash .d-records .d-col-season, .is-dash .d-records .d-col-species,
  .is-dash .d-blind .d-col-season { display: none; }
  .is-dash .d-records .d-col-people .d-cell-trunc { max-width: 28ch; }
  .is-dash .d-records .d-table:has(th.d-col-actions) .d-col-people { display: none; }
  /* If the table still overflows, the actions stay pinned to the panel's right edge. */
  .is-dash .d-records .d-table .d-col-actions { position: sticky; right: 0; z-index: 1; background: var(--d-panel); border-left: 1px solid var(--d-border); }
  .is-dash .d-records .d-table th.d-col-actions { z-index: 2; background: var(--d-raised); }
  .is-dash .d-records .d-table tbody tr:is(:hover, :focus-within) td.d-col-actions { background: var(--d-hover); }
  .is-dash .d-records .d-table tbody tr.is-link:active td.d-col-actions { background: var(--d-selected); }
}
@media (max-width: 639.98px) {
  .is-dash .d-records .d-col-people, .is-dash .d-blind .d-col-species { display: none; }
  .is-dash .d-records .d-col-blind .d-cell-trunc { max-width: 13ch; }
  .is-dash .d-blind .d-col-people .d-cell-trunc { max-width: 13ch; }
  .is-dash .d-records .d-weekday, .is-dash .d-blind .d-weekday { display: none; }
  .is-dash .d-records .d-table :is(th, td), .is-dash .d-blind .d-table :is(th, td) { padding-inline: 8px; }
  .is-dash .d-records .d-table :is(th, td):first-child, .is-dash .d-blind .d-table :is(th, td):first-child { padding-left: 12px; }
  .is-dash .d-records .d-table :is(th, td):last-child, .is-dash .d-blind .d-table :is(th, td):last-child { padding-right: 12px; }
}

/* A hunt report: figures across the top, then the hunt (left) beside its cover photo,
   facts and actions (right); one column under 1100px with the facts first. */
/* The title names every hunter; two lines at most (the Hunters panel lists them all). */
.is-dash .d-report .page-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.is-dash .d-report .d-stats, .is-dash .d-blind .d-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* The morning's Conditions card on a report keeps its own four tiles, two by two on a phone. */
.is-dash .d-report .d-morning .d-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1023.98px) { .is-dash .d-report .d-morning .d-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.is-dash .d-report .d-stat-value { overflow-wrap: anywhere; }
.is-dash .d-report-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); align-items: start; gap: 16px; }
.is-dash .d-report-main, .is-dash .d-report-side { display: grid; align-content: start; gap: 16px; min-width: 0; }
/* Flush panels (tables) keep their titles level with the padded panels beside them. */
.is-dash .d-report .panel--flush > .panel-head { padding-top: 16px; }
.is-dash .d-report-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; gap: 16px; }
.is-dash .d-report-cover { aspect-ratio: 4 / 3; width: 100%; border: 1px solid var(--d-border); border-radius: var(--d-radius-lg); }
@media (min-width: 1100px) {
  .is-dash .d-report-actions { display: grid; }
  .is-dash .d-report-actions .pill { width: 100%; }
}
@media (max-width: 1099.98px) {
  .is-dash .d-report-body { grid-template-columns: minmax(0, 1fr); }
  .is-dash .d-report-side { display: contents; }
  .is-dash .d-report-cover { order: -2; max-width: 560px; aspect-ratio: 16 / 9; }
  .is-dash .d-report-facts { order: -1; }
}

/* Facts: label left, value right in the side column; label over value, several to a
   row, when the page is one column. */
.is-dash .d-facts { display: grid; gap: 8px; margin: 0; font-size: 13px; }
.is-dash .d-fact { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-content: start; gap: 12px; }
.is-dash .d-facts dt { color: var(--d-muted); font-size: 12px; font-weight: 500; line-height: 20px; }
.is-dash .d-facts dd { margin: 0; color: var(--d-text); line-height: 20px; overflow-wrap: anywhere; }
@media (min-width: 640px) and (max-width: 1099.98px) {
  .is-dash .d-facts { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px 16px; }
  .is-dash .d-fact { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
.is-dash .d-report-dogs { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.is-dash .d-report-dogs li { display: flex; justify-content: space-between; gap: 12px; }
.is-dash .d-report-dog { font-weight: 500; }

/* Hunters: one ruled row each, initials beside the name. */
.is-dash .d-report-people { display: grid; margin: 0; padding: 0; list-style: none; }
.is-dash .d-report-people li { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px 0; font-size: 13px; font-weight: 500; }
/* Rule above every shown row but the first one on the page (the pager hides the rest). */
.is-dash .d-report-people li:not([hidden]) ~ li { border-top: 1px solid var(--d-border); }
.is-dash .d-report-people li[hidden] { display: none; }
.is-dash .d-report-person { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* A blind: totals caption, compact filter chips (long lists scroll in place). */
.is-dash .d-blind-totals { display: grid; gap: 8px; }
.is-dash .d-blind-caption { margin: 0; color: var(--d-muted); font-size: 12px; font-weight: 500; }
.is-dash .d-blind-filters { gap: 12px; }
.is-dash .d-blind .filter-group { gap: 6px; }
.is-dash .d-blind .filter-group legend { margin-bottom: 6px; color: var(--d-muted); font-size: 12px; font-weight: 500; }
/* About three rows of chips show; a longer list (a busy blind's hunters) scrolls inside
   its box, with room for the focus ring. */
.is-dash .d-blind .chip-toggles { gap: 6px; max-height: 116px; margin: -4px; padding: 4px; overflow-y: auto; }

@media (max-width: 639.98px) {
  /* Three narrow cards: a two-line label must not push its figure below its neighbours'. */
  .is-dash .d-report .d-stat, .is-dash .d-blind .d-stat { align-content: space-between; padding: 12px; }
  .is-dash .d-report .d-stat-value, .is-dash .d-blind .d-stat-value { font-size: 22px; }
}

/* Club calendar (#1, views/calendar.js): a month grid with event chips, then the month as
   a list. Kinds use dataviz slots 1–4, validated on the raised surface (hunt blue, work day
   orange, season dates aqua, other yellow); every chip carries its title and the legend
   names the kinds, so colour never stands alone. */
.is-dash .d-calendar .is-hunt { --cal: #3987e5; }
.is-dash .d-calendar .is-work_day { --cal: #d95926; }
.is-dash .d-calendar .is-season { --cal: #199e70; }
.is-dash .d-calendar .is-other { --cal: #c98500; }
.is-dash .d-cal-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.is-dash .d-cal-month { margin: 0 6px; color: var(--d-text); font-size: 16px; font-weight: 600; }
.is-dash .d-cal-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 10px; padding: 0; list-style: none; color: var(--d-muted); font-size: 12px; }
.is-dash .d-cal-dot { display: inline-block; flex: none; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--cal); }
.is-dash .d-cal { width: 100%; table-layout: fixed; border-collapse: collapse; }
.is-dash .d-cal th { padding: 4px; color: var(--d-muted); font-size: 11.5px; font-weight: 500; text-align: left; }
.is-dash .d-cal td { height: 92px; padding: 4px; border: 1px solid var(--d-border); vertical-align: top; }
.is-dash .d-cal td.is-outside { background: var(--d-bg); }
.is-dash .d-cal td.is-outside .d-cal-day { color: var(--d-faint); }
.is-dash .d-cal td.is-marked { box-shadow: inset 0 0 0 2px var(--d-text-2); }
.is-dash .d-cal-day { display: inline-block; min-width: 22px; padding: 1px 4px; border: 0; border-radius: 4px; background: none; color: var(--d-text-2); font: 600 12px/1.4 var(--d-sans); text-align: left; }
.is-dash button.d-cal-day { cursor: pointer; }
.is-dash button.d-cal-day:hover { background: var(--d-hover); color: var(--d-text); }
.is-dash .d-cal-chip {
  display: block; margin-top: 3px; padding: 2px 6px; overflow: hidden; border-left: 3px solid var(--cal); border-radius: 3px;
  background: color-mix(in srgb, var(--cal) 22%, transparent); color: var(--d-text); font-size: 11.5px; text-decoration: none; text-overflow: ellipsis; white-space: nowrap;
}
.is-dash .d-cal-chip:hover { background: color-mix(in srgb, var(--cal) 36%, transparent); color: var(--d-text); }
.is-dash .d-cal-more { display: block; margin-top: 2px; color: var(--d-muted); font-size: 11px; }
.is-dash .d-cal-list { margin: 0; padding: 0; list-style: none; }
.is-dash .d-cal-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--d-border); scroll-margin-top: 80px; }
.is-dash .d-cal-item:last-child { border-bottom: 0; }
.is-dash .d-cal-item:target, .is-dash .d-cal-item.is-target { background: var(--d-raised); outline: none; }
.is-dash .d-cal-item .d-cal-dot { margin-top: 6px; }
.is-dash .d-cal-text p { margin: 0; }
.is-dash .d-cal-when { color: var(--d-muted); font-size: 12px; }
.is-dash .d-cal-title { color: var(--d-text); font-weight: 600; }
.is-dash .d-cal-place { color: var(--d-text-2); font-weight: 400; }
.is-dash .d-cal-notes { color: var(--d-text-2); font-size: 13px; white-space: pre-wrap; }
.is-dash .d-cal-by { color: var(--d-muted); font-size: 11.5px; }
.is-dash .d-cal-actions { display: flex; gap: 6px; }
.is-dash .d-cal-dialog { width: min(520px, 92vw); }
.is-dash .d-cal-form { display: grid; gap: 12px; }
.is-dash .d-cal-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 639.98px) {
  .is-dash .d-cal td { height: 64px; padding: 2px; }
  .is-dash .d-cal-chip { padding: 1px 3px; border-left-width: 2px; font-size: 10px; }
  .is-dash .d-cal-row { grid-template-columns: minmax(0, 1fr); }
  .is-dash .d-cal-item { grid-template-columns: auto minmax(0, 1fr); }
  .is-dash .d-cal-actions { grid-column: 2; }
}

/* Club tasks (#4, views/tasks.js): one row per task with a tick box; overdue in rose with its
   words ("Overdue by 3 days"), never colour alone. Rows reuse the calendar list styles. */
.is-dash .d-task { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--d-border); }
.is-dash .d-task:last-child { border-bottom: 0; }
.is-dash .d-task-tick {
  display: inline-grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; padding: 0; border: 1.5px solid var(--d-border-strong);
  border-radius: 6px; background: none; color: var(--d-emerald); cursor: pointer;
}
.is-dash .d-task-tick:hover { border-color: var(--d-text-2); }
.is-dash .d-task-tick.is-still { cursor: default; }
.is-dash .d-task-tick.is-done { border-color: var(--d-emerald-border); background: var(--d-emerald-bg); }
.is-dash .d-task-tick .icon { width: 14px; height: 14px; }
.is-dash .d-task.is-done .d-cal-title { color: var(--d-muted); text-decoration: line-through; }
.is-dash .d-task-who { display: inline-flex; align-items: center; gap: 6px; }
.is-dash .d-task-who .d-avatar { width: 18px; height: 18px; font-size: 8px; }
.is-dash .d-task-late { color: var(--d-rose); font-weight: 600; }
.is-dash .d-task-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 639.98px) {
  .is-dash .d-task { grid-template-columns: auto minmax(0, 1fr); }
  .is-dash .d-task .d-cal-actions { grid-column: 2; }
}

/* Club equipment (#5/#7, views/equipment.js): task-style rows with the quantity first, the
   condition as a badge with its words, and the service log folded under each item. */
.is-dash .d-equip-qty { min-width: 34px; padding-top: 1px; color: var(--d-text-2); font: 600 13px/1.4 var(--d-sans); font-variant-numeric: tabular-nums; }
.is-dash .d-equip .d-badge { vertical-align: 1px; }
.is-dash .d-equip-history { margin-top: 6px; color: var(--d-text-2); font-size: 12.5px; }
.is-dash .d-equip-history summary { color: var(--d-muted); cursor: pointer; }
.is-dash .d-equip-history ul { display: grid; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }
.is-dash .d-equip-history li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding-left: 10px; border-left: 2px solid var(--d-border); }
.is-dash .d-equip-history li .d-cal-when { grid-column: 1; }
.is-dash .d-equip-history li > span:nth-child(2) { grid-column: 1; }
.is-dash .d-equip-history li .d-cal-actions { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
@media (max-width: 639.98px) { .is-dash .d-equip-history li .d-cal-actions { grid-column: 1; grid-row: auto; } } /* Edit and Delete under the entry */

/* Bird log (#15/#9a, views/birds.js): the band number first in a fixed-width chip, the report
   status as a badge with its words, and last week's sightings as a short digest. */
.is-dash .d-bird-band { min-width: 92px; max-width: 120px; padding: 2px 6px; border: 1px solid var(--d-border); border-radius: 6px; color: var(--d-text); font: 600 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: center; overflow-wrap: anywhere; }
.is-dash .d-birds .d-badge { vertical-align: 1px; }
.is-dash .d-bird-report { margin-left: 8px; color: var(--d-amber, inherit); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.is-dash .d-bird-digest { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; color: var(--d-text-2); font-size: 13.5px; }
.is-dash .d-bird-digest strong { color: var(--d-text); font-weight: 600; }
@media (max-width: 639.98px) {
  .is-dash .d-bird-band { min-width: 0; }
  .is-dash .d-bird-report { display: inline-block; margin: 4px 0 0; }
}

/* Club expenses (#3, views/expenses.js): category and month bars side by side with room for
   dollar figures, and a ledger whose description column carries the payee and notes. */
.is-dash .d-exp-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.is-dash .d-expenses .bar-row { grid-template-columns: minmax(80px, 150px) minmax(0, 1fr) 132px; }
.is-dash .d-expenses .bar-value { white-space: nowrap; }
.is-dash .d-expenses .panel--flush > .panel-head { padding: 16px 16px 0; }
.is-dash .d-exp-what { display: grid; gap: 2px; min-width: 160px; white-space: normal; }
.is-dash .d-exp-sub { color: var(--d-muted); font-size: 12.5px; }
.is-dash .d-expenses td.d-exp-day { white-space: nowrap; }
.is-dash .d-expenses td.d-exp-actions .d-cal-actions { justify-content: flex-end; flex-wrap: nowrap; }
@media (max-width: 899.98px) { .is-dash .d-exp-split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 639.98px) {
  .is-dash .d-expenses .bar-row { grid-template-columns: minmax(64px, 96px) minmax(48px, 1fr) 112px; gap: 8px; }
  .is-dash .d-expenses .bar-name, .is-dash .d-expenses .bar-value { font-size: 12.5px; }
}
.is-dash .d-exp-receipt { white-space: nowrap; }
.is-dash .d-exp-receipts { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.is-dash .d-exp-receipts li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; color: var(--d-text-2); font-size: 13px; overflow-wrap: anywhere; }
@media print { .is-dash .d-expenses .d-exp-actions, .is-dash .d-exp-receipt.is-empty { display: none; } }

/* Club documents (#6, views/documents.js): a file-type tag first, then the title, its
   description and the file's name, size and who added it. */
.is-dash .d-doc-type { min-width: 44px; padding: 2px 6px; border: 1px solid var(--d-border); border-radius: 6px; color: var(--d-text-2); font: 600 11px/1.5 var(--d-sans); letter-spacing: 0.04em; text-align: center; }
.is-dash .d-doc .d-cal-when { overflow-wrap: anywhere; }
.is-dash .field-file { padding: 8px; }
.is-dash .field-file::file-selector-button { margin-right: 10px; padding: 6px 12px; border: 1px solid var(--d-border); border-radius: 999px; background: var(--d-raised); color: var(--d-text); font: 500 13px/1 var(--d-sans); cursor: pointer; }

/* Licenses & stamps (#16, views/licenses.js): document-style rows with a status badge in
   words, and a one-line tally above the admins' club view. */
.is-dash .d-licenses .d-badge { vertical-align: 1px; }
.is-dash .d-lic-summary { margin: 0; color: var(--d-text-2); font-size: 13.5px; }
