/* Daily report (/admin/daily-report) — per-date shelter overview for
   volunteers. Stat cards up top, then sortable tables per section. */

.dr-datenav {
  display: flex; align-items: center; gap: 1rem;
  margin: 0.5rem 0 1.25rem;
  flex-wrap: wrap;
}
.dr-dayhop { font-size: 0.9rem; }
.dr-dateform { display: inline-flex; gap: 0.4rem; align-items: center; }
.dr-dateform input[type="date"] {
  font: inherit; font-size: 0.9rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--line); border-radius: 6px;
  background: #fff;
}
.dr-dateform button {
  font: inherit; font-size: 0.85rem;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--line); border-radius: 6px;
  background: #fff; cursor: pointer;
}

.dr-nocensus {
  padding: 1rem 1.25rem;
  background: #fef3c7; color: #92400e;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}
.dr-nocensus code { background: rgba(255,255,255,0.6); padding: 0.1rem 0.3rem; border-radius: 4px; }

.dr-cards {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.dr-card {
  min-width: 7.5rem;
  padding: 0.7rem 1rem;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  display: flex; flex-direction: column; gap: 0.1rem;
}
.dr-card strong { font-size: 1.5rem; line-height: 1.1; }
.dr-card span { font-size: 0.78rem; color: var(--muted); }
.dr-card-up strong { color: #166534; }
.dr-card-down strong { color: var(--bad); }
.dr-cards-small .dr-card { min-width: 6.5rem; padding: 0.5rem 0.8rem; }
.dr-cards-small .dr-card strong { font-size: 1.2rem; }

.dr-section { margin-bottom: 2rem; }
.dr-section h2 { font-size: 1.15rem; margin: 0 0 0.5rem; }
.dr-section h3 { font-size: 0.95rem; margin: 1rem 0 0.4rem; }

.dr-alert {
  padding: 0.75rem 1rem;
  background: #fee2e2; color: #7f1d1d;
  border-left: 4px solid var(--bad);
  border-radius: 6px;
  margin-bottom: 0.75rem;
}
.dr-alert h3 { margin: 0 0 0.4rem; font-size: 0.95rem; }
.dr-alert ul { margin: 0; padding-left: 1.2rem; }
.dr-allclear { color: #166534; font-size: 0.92rem; }
.dr-changes { margin: 0.25rem 0; padding-left: 1.2rem; font-size: 0.92rem; }

.dr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: #fff;
  border: 1px solid var(--line); border-radius: 8px;
}
.dr-table th, .dr-table td {
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--line);
}
.dr-table tbody tr:last-child td { border-bottom: 0; }
.dr-table tbody tr:hover { background: #faf7f0; }

/* Sortable headers: pointer + a direction caret via aria-sort. */
.dr-table.sortable th[data-sort] { cursor: pointer; user-select: none; white-space: nowrap; }
.dr-table.sortable th[data-sort]:hover { color: var(--accent); }
.dr-table.sortable th[data-sort]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.dr-table.sortable th[aria-sort]::after { color: var(--accent); }
.dr-table.sortable th[aria-sort="descending"]::after { content: " \2193"; }
.dr-table.sortable th[aria-sort="ascending"]::after { content: " \2191"; }

#census-filter {
  font: inherit; font-size: 0.9rem;
  width: 100%; max-width: 24rem;
  padding: 0.4rem 0.7rem;
  margin-bottom: 0.6rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: #fff;
}

/* Status chips, colored by the server-computed status_group. */
.dr-status {
  display: inline-block;
  font-size: 0.78rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: #f1ede3;
  white-space: nowrap;
}
.dr-g-available  { background: #dcfce7; color: #166534; }
.dr-g-foster     { background: #dbeafe; color: #1e40af; }
.dr-g-vet        { background: #fef3c7; color: #92400e; }
.dr-g-quarantine { background: #fee2e2; color: #991b1b; }
.dr-g-behavioral { background: #ede9fe; color: #5b21b6; }
.dr-g-hold       { background: #e5e7eb; color: #374151; }

.dr-error { color: var(--bad); }

/* Thumbnails: small, left of the name; the photo is often a better
   identifier than the (sometimes arbitrary or missing) name. */
.dr-thumb {
  width: 36px; height: 36px;
  border-radius: 6px;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 0.45rem;
  cursor: zoom-in;
  background: #ece6da;
}
.dr-thumb-empty { display: inline-block; cursor: default; }

/* Fullscreen lightbox built by lightbox.js. The explicit [hidden] rule
   matters: display:flex on the id selector would otherwise override the
   UA's [hidden]{display:none} and the invisible overlay would swallow
   every click on the page. */
#lightbox[hidden] { display: none; }
#lightbox {
  position: fixed; inset: 0;
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.82);
  cursor: zoom-out;
}
#lightbox img {
  max-width: 92vw; max-height: 92vh;
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

@media (max-width: 720px) {
  .dr-table { display: block; overflow-x: auto; }
  .dr-card { min-width: 6rem; flex: 1 1 28%; }
}
