/* `zz_` prefix sorts this file last in Propshaft's `:app` glob, so these
   rules win the cascade against tailwind/tom-select/trix at equal specificity. */

.ts-wrapper.single .ts-control {
  background: linear-gradient(to bottom, #ffffff, #f3f4f6);
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  color: var(--color-body);
}

.ts-wrapper.focus .ts-control,
.ts-wrapper.single.focus .ts-control {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 1px var(--color-primary);
}

.ts-wrapper.single .ts-control:after {
  border: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: -0.625rem;
  right: 0.25rem;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23666' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.ts-wrapper.single.dropdown-active .ts-control:after {
  border: none;
  transform: rotate(180deg);
  margin-top: -0.625rem;
}

.ts-control input::placeholder,
.ts-control input::-webkit-input-placeholder {
  color: var(--color-body);
  opacity: 1;
}

/* Right-align Save/Cancel rows in any form whose action row uses `class="flex"`. */
form div.flex:has(> input[type="submit"]),
form div.flex:has(> button[type="submit"]) {
  justify-content: flex-end;
}

/* Zebra striping + white headers + 1rem horizontal cell padding for tables
   rendered via shared/_searchable_table.html.erb (which adds the
   `.searchable-table` class). Scoped so grade tables, barge-card step
   grids, and admin layouts aren't affected. */
table.searchable-table > thead {
  background-color: #ffffff;
}
table.searchable-table > tbody > tr:nth-child(odd) {
  background-color: #f5f6f8; /* between gray-50 and gray-100 */
}
table.searchable-table > thead > tr > th,
table.searchable-table > tbody > tr > td {
  padding-left: 1rem;
  padding-right: 1rem;
}
