/* InSession shared app styles (loaded on every page via partials/head.ejs). */

/* Traffic/Criminal vs Civil hearing-kind badges on the Dashboard. Mirrors the
   Live Display / Monitor kind chips (violet = Traffic/Criminal, orange = Civil)
   so the docket kind reads consistently across every surface. Deliberately
   outside the blue/green party palette and the amber "late" / red "cancelled"
   accents. */
.kind-badge {
  border: 1px solid transparent;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kind-badge.kind-tc {
  color: #6f42c1;
  background-color: #f1eafc;
  border-color: #d5c2f0;
}

.kind-badge.kind-civil {
  color: #b3560a;
  background-color: #fdf1e5;
  border-color: #f3d6b3;
}

/* Per-party annotation icons on the Dashboard: greyed when empty, solid and
   colored when set — teal for a note, amber for a substitute attorney (each
   matching its accent on Live Display/Monitor). */
.annotation-btn {
  color: #adb5bd;
  line-height: 1;
  vertical-align: baseline;
  text-decoration: none;
}
.annotation-btn:hover,
.annotation-btn:focus {
  color: #6c757d;
}
.annotation-note.has-value,
.annotation-note.has-value:hover,
.annotation-note.has-value:focus {
  color: #0f766e;
}
.annotation-substitute.has-value,
.annotation-substitute.has-value:hover,
.annotation-substitute.has-value:focus {
  color: #b26a00;
}

/* Swap outline -> solid icon when the field is set. Both paths are in the
   markup (partials/noteButton.ejs); only the `has-value` class decides which
   shows, so dashboard.js just toggles that class and the icon follows. */
.annotation-btn .annotation-icon-filled {
  display: none;
}
.annotation-btn.has-value .annotation-icon-outline {
  display: none;
}
.annotation-btn.has-value .annotation-icon-filled {
  display: inline;
}

/* Substitute counsel shown beneath the listed attorney's name. Amber so it
   reads as "someone else is appearing" without competing with the party
   colors; the listed attorney above it stays authoritative. */
.substitute-line {
  font-size: 0.875rem;
  color: #b26a00;
  font-weight: 600;
}
/* Free-text comment on a recorded Warrant Center action, shown under its
   badge on Search Appearances. Italic and muted so the action itself stays
   the thing you scan for; matches .action-log-comment on the Warrant Center. */
.action-comment {
  font-size: 0.8125rem;
  font-style: italic;
  color: #495057;
}

.substitute-line .substitute-tag {
  display: inline-block;
  background: #fff3cd;
  border: 1px solid #f1d592;
  border-radius: 4px;
  padding: 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 4px;
}

/* ── Dashboard check-in toggle ─────────────────────────────────
   Unchecked: outline button, empty box, "Check in".
   Checked:   solid button, a check, "Checked in".
   State lives in aria-pressed (set by the server and by renderCheckinButton()
   in dashboard.js), so the box and check are drawn here from that one
   attribute — no icon swapping in JS. The fill alone wasn't distinct enough
   at a glance; the box/check plus the label wording make the state legible. */
.checkin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
  font-weight: 600;
  /* Wide enough for "Checked in", so toggling never shifts the layout. */
  min-width: 7.5rem;
}

.checkin-btn .checkin-box {
  position: relative;
  flex: 0 0 auto;
  width: 0.95em;
  height: 0.95em;
  border: 1.5px solid currentColor;
  border-radius: 3px;
}

.checkin-btn[aria-pressed="true"] .checkin-box {
  border-color: transparent;
}

.checkin-btn[aria-pressed="true"] .checkin-box::after {
  content: "";
  position: absolute;
  left: 0.3em;
  top: 0.04em;
  width: 0.32em;
  height: 0.62em;
  border: solid currentColor;
  border-width: 0 0.15em 0.15em 0;
  transform: rotate(45deg);
}

.checkin-btn.is-saving {
  opacity: 0.75;
}

/* ── Party notes as a second line under a record ───────────────
   Search Appearances, Warrant Center and the missed-appearance reports
   (views/partials/noteLine.ejs). Teal, matching how notes read on the Live
   Display and Monitor. Each record is its own <tbody class="record"> so its
   note line stripes, filters and prints together with it. */
.record.is-odd > tr > td {
  background-color: rgba(0, 0, 0, 0.035);
}
tr.has-note > td {
  border-bottom: 0;
}
tr.note-line > td {
  padding-top: 0;
  padding-left: 1.25rem;
  font-size: 0.85em;
  font-style: italic;
  color: #0f766e;
}
.note-label {
  font-weight: 600;
  font-style: normal;
}
.note-sep {
  margin: 0 0.5rem;
  color: #6c757d;
}
@media print {
  .record {
    break-inside: avoid;
  }
}

/* ── Filter toolbar: Dashboard card header + Warrant Center ────
   [left] | search (centered) | [right]. On the Dashboard it lives in the card
   header, outside the scrolling hearing list; on the Warrant Center it sits
   in the pinned top section (.page-sticky-top). Equal side columns keep the
   search truly centered. */
.dashboard-toolbar,
.filter-toolbar {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 360px) 1fr;
  align-items: center;
  gap: 0.75rem;
}
:is(.dashboard-toolbar, .filter-toolbar) .toolbar-left {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
:is(.dashboard-toolbar, .filter-toolbar) .toolbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}
/* Narrow screens: left + right on one row, search full-width below. */
@media (max-width: 991.98px) {
  .dashboard-toolbar,
  .filter-toolbar {
    grid-template-columns: 1fr auto;
  }
  :is(.dashboard-toolbar, .filter-toolbar) .toolbar-center {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}
/* A page's whole top section (header, summary, toolbar) pinned while a long
   list scrolls under it — the Warrant Center. The negative margin + matching
   padding cancel the container's top padding, so the page looks the same at
   rest and keeps that breathing room once stuck. The non-production label
   hangs over the header's empty center, so it needs no offset. Opaque, so
   rows don't show through. Desktop widths only: on a phone the wrapped
   header + toolbar would pin most of the screen. */
.page-sticky-top {
  padding-bottom: 0.75rem;
}
@media (min-width: 992px) {
  .page-sticky-top {
    position: sticky;
    top: 0;
    z-index: 1020;
    margin-top: -1rem;
    padding-top: 1rem;
    background-color: var(--bs-light, #f8f9fa);
  }
}
@media print {
  .page-sticky-top {
    position: static;
  }
}

/* Dashboard search: our own clear button at the far right of the field. */
.hearing-search-wrap {
  position: relative;
}
.hearing-search-wrap .form-control {
  padding-right: 2rem; /* keep typed text clear of the button */
}
/* Hide the browser's built-in clear "x" so there's only ours. */
#hearing-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}
.hearing-search-clear {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  width: 1.4rem;
  height: 1.4rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #6c757d;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}
.hearing-search-clear:hover,
.hearing-search-clear:focus-visible {
  background: #e9ecef;
  color: #212529;
}
