/* app/assets/stylesheets/components/schedule.css */

.schedule-container {}

/* -- Filters --
   Canonical filter-bar look (style guide#filter-bar): tinted surface with
   hairline border, label + control pairs, optional right-aligned action
   group. .schedule-filters is shared across schedule/games/standings. */

.schedule-filters {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;

  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.schedule-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.schedule-filter__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-3);
  letter-spacing: 0.12em;
}

.schedule-filter__select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  font: inherit;
  color: var(--ink);
  min-width: 150px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.schedule-filter__select:hover {
  border-color: var(--ink-3);
}
.schedule-filter__select:focus {
  outline: 0;
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px rgba(229, 183, 1, 0.18);
}

/* -- Filter Action Buttons --
   Match the canonical .btn / .btn--primary / .btn--secondary look so
   filter-bar buttons sit consistently with action buttons elsewhere. */

.schedule-actions__bulk-add,
.schedule-actions__rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: var(--gold);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s;
}
.schedule-actions__bulk-add:hover,
.schedule-actions__rank:hover {
  background: var(--gold-dark);
}

.schedule-actions__clear,
.schedule-actions__rank-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.schedule-actions__clear:hover,
.schedule-actions__rank-cancel:hover {
  background: var(--bg-2);
  border-color: var(--ink-3);
}

.schedule-filter-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
  align-items: flex-end;
}

/* --  Table --  */

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 1rem;
  margin: 0;
}

/* Canonical card-table header look (style guide). */
.schedule-table thead th {
  padding: 12px 14px;
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.schedule-table tbody td {
  border-top: 1px solid var(--line-2);
  padding: 10px 14px;
}
.schedule-table tbody tr:first-child td { border-top: 0; }
.schedule-table tbody tr:last-child td  { padding-bottom: 14px; }

/* Column widths -- keep table sizing static regardless of header or cell state.
   Period sized to fit "Week 99"; date column sized to fit "Sep 23, 2026". */
.schedule-table col.col-period   { width: 7rem;   min-width: 7rem; }
.schedule-table col.col-date     { width: 7.5rem; min-width: 7.5rem; }
.schedule-table col.col-time     { width: 6rem;   min-width: 6rem; }
.schedule-table col.col-facility { width: 10%; }
.schedule-table col.col-location { width: 10%; }
.schedule-table col.col-group    { width: 9%; }
.schedule-table col.col-team     { width: 11%; }
.schedule-table col.col-score    { width: 4.5rem; min-width: 4.5rem; }
.schedule-table col.col-games    { width: 5%; }
.schedule-table col.col-actions  { width: 7%; }

.schedule-table tbody tr:hover {
  background: var(--bg-2);
}
.schedule-row {
  height: 2.5rem;
}

.schedule-row--finalized {
  background-color: var(--bg-2);
}

/* Empty-state row shown when no matches match the current filters. */
.schedule-table__empty-row:hover { background: transparent; }
.schedule-table__empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--ink-3);
  font-style: italic;
  font-size: 0.95rem;
}
/* Inline new Match form */
.schedule-form-row {
  background-color: var(--bg-2);
  border-radius: 10px;
}

.schedule-input {
  width: 100%;
  box-sizing: border-box;

  border: 1px solid var(--ink-4);
  border-radius: 6px;
  background: white;

  padding: 0.25rem 0.35rem;
  font-size: 1rem;
}

.schedule-input:hover {
  border-color: var(--silver);
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.15);
}

.schedule-period-display {
  font-size: 0.9rem;
  color: var(--ink-2);
  padding: 0.25rem 0.35rem;
  white-space: nowrap;
}

.schedule-form__submit {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--green);
  color: white;
  padding-bottom: 3px;

  cursor: pointer;
}

.schedule-form__submit:hover {
  filter: brightness(90%);
}

/* -- Match Cells / Edit -- */

.match-cell {
  position: relative;
  height: 100%;
  padding: 0 0.35rem;
  vertical-align: middle;
  overflow: hidden;
}
.match-cell__display{
  display: block;
  cursor: pointer;
  text-decoration: none;
  border-radius: 8px;
  padding: 0 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-cell__display:hover{
  background-color: var(--ink-4);
}

.match-cell__display--readonly {
  cursor: default;
}
.match-cell__display--readonly:hover {
  background-color: transparent;
}

.match-cell__input {
  width: 100%;
  padding: 0 0.5rem;
  border: 1px solid var(--silver-light);
  border-radius: 8px;
}

.match-cell--actions {
  width: 4rem;
  white-space: nowrap;
}

.match-cell__delete-form {
  display: inline-block;
  margin: 0;
}

.match-cell__checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 1.1rem;
  height: 1.1rem;
  border: 1.5px solid var(--silver, #bbb);
  border-radius: 5px;
  cursor: pointer;
  background: white;
  vertical-align: middle;
  margin-right: 0.35rem;
  position: relative;
}

.match-cell__checkbox:checked {
  background-color: var(--gold, #f5c518);
  border-color: var(--gold, #f5c518);
}

.match-cell__checkbox:checked::after {
  content: "✓";
  position: absolute;
  inset: 0;
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1rem;
  text-align: center;
}

.match-cell__delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--ink-3);
  font-size: 0.95rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  vertical-align: middle;
}

.match-cell__delete:hover {
  background-color: var(--ink-4);
  color: var(--red, #c0392b);
}

.match-cell__lock-form {
  display: inline-block;
  margin: 0;
}

.match-cell__lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--ink-3);
  padding: 0;
  cursor: pointer;
  vertical-align: middle;
}

.match-cell__lock:hover {
  background-color: var(--ink-4);
  color: var(--ink-1);
}

.match-cell__lock--active {
  color: var(--gold, #f5c518);
}

.match-cell__lock--active:hover {
  color: var(--ink-1);
}

.game-cell__locked-score {
  display: inline-block;
  width: 100%;
  text-align: center;
  padding: 0.25rem 0;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

/* -- Bulk actions dropdown (in last column header) -- */

.schedule-table thead th.match-cell--actions-header {
  position: relative;
  padding: 0 0.5rem;
  overflow: visible;
  white-space: nowrap;
}

.bulk-actions__select-all {
  margin-right: 0.35rem;
}

.bulk-actions__select-all:indeterminate {
  background-color: var(--gold, #f5c518);
  border-color: var(--gold, #f5c518);
}

.bulk-actions__select-all:indeterminate::after {
  content: "–";
  position: absolute;
  inset: 0;
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1rem;
  text-align: center;
}

.bulk-actions {
  position: relative;
  display: inline-block;
}

.bulk-actions__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  background: var(--gold, #f5c518);
  color: var(--darkest, #222);
  border: none;
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.bulk-actions__toggle:hover {
  filter: brightness(95%);
}

.bulk-actions__menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  background: white;
  border: 1px solid var(--ink-4);
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  min-width: 160px;
  z-index: 50;
}

.bulk-actions__menu button {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--red, #c0392b);
}

.bulk-actions__menu button:hover {
  background-color: var(--bg-2);
}

/* -- Sortable headers -- */

.schedule-table__sort {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.schedule-table__sort:hover {
  color: var(--gold, #f5c518);
}

.schedule-table__sort.is-active {
  font-weight: 700;
}

/* -- Pagination -- */

.schedule-footer {
  display: flex;
  justify-content: center;
  padding: 0.25rem 0;
}

/* ==============================================
   BULK SCHEDULE PAGE
   ============================================== */

.hidden { display: none !important; }

/* Modal overlay — shown when the turbo frame has content */
turbo-frame#modal:not(:empty) {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: block;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 12, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1.5rem;
}

/* Bulk schedule modal panel */
.bulk-schedule {
  display: flex;
  flex-direction: column;
  width: min(1200px, 96vw);
  height: min(88vh, 860px);
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}

.bulk-schedule__header {
  flex-shrink: 0;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--ink-4);
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.bulk-schedule__title {
  font-size: 1.5rem;
  font-weight: 700;
}

.bulk-schedule__division-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bulk-schedule__content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.bulk-schedule__footer {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--ink-4);
  background: white;
}

/* -- Sections -- */

.bulk-section {
  border: 1px solid var(--ink-4);
  border-radius: 10px;
  overflow: visible;
}

.bulk-section__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  cursor: pointer;
  user-select: none;
  border-radius: 10px;
}

.bulk-section__toggle:hover { background: var(--bg-2); }

.bulk-section__header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.bulk-section__heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bulk-section__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--ink);
  color: white;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.bulk-section__label {
  font-weight: 700;
  font-size: 1rem;
}

.bulk-section__chevron {
  font-size: 0.75rem;
  color: var(--ink-3);
}

.bulk-section__body {
  padding: 0 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bulk-section__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--bg-2);
}

/* -- Form rows -- */

.bulk-form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.bulk-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 140px;
}

.bulk-form-group--wide { flex: 1; min-width: 220px; }
.bulk-form-group--relative { position: relative; }
.bulk-form-group--date { flex: 1.4; min-width: 11rem; }

.bulk-form-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08rem;
  color: var(--ink-3);
}

.bulk-form-select,
.bulk-form-input {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0.35rem 0.5rem;
  width: 100%;
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
}

.bulk-form-select:hover,
.bulk-form-input:hover {
  border-color: var(--ink-3);
}
.bulk-form-select:focus,
.bulk-form-input:focus {
  outline: 0;
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px rgba(229, 183, 1, 0.18);
}

.bulk-add-link {
  font-size: 0.75rem;
  color: var(--ink-3);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  text-decoration: underline;
}
.bulk-add-link:hover { color: var(--ink); }

.bulk-inline-add {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.bulk-inline-add__input { flex: 1; }

/* -- Time slot tag input -- */

.bulk-tag-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0.35rem 0.5rem;
  min-height: 2.25rem;
  cursor: text;
  transition: border-color 0.15s;
}

.bulk-tag-input--locations { cursor: pointer; }
.bulk-tag-input--locations:hover { border-color: var(--ink-3); }

.bulk-tag-placeholder {
  color: var(--ink-4);
  font-size: 0.9rem;
}

.bulk-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-2);
  border: 1px solid var(--ink-4);
  border-radius: 99px;
  padding: 0 0.5rem 0 0.65rem;
  height: 1.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.bulk-chip__remove {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  color: var(--ink-3);
  font-size: 1rem;
}
.bulk-chip__remove:hover { color: var(--red); }

.bulk-time-input {
  border: none;
  outline: none;
  font-size: 0.85rem;
  min-width: 90px;
  background: transparent;
}

.bulk-tag-add {
  background: var(--green);
  color: white;
  border: none;
  border-radius: 50%;
  width: 1.4rem;
  height: 1.4rem;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bulk-tag-add:hover { filter: brightness(90%); }

/* -- Location dropdown -- */

.bulk-location-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  min-width: 340px;
  width: 100%;
  background: white;
  border: 1px solid var(--ink-4);
  border-radius: 10px;
  box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,0.12);
  overflow: hidden;
}

.bulk-dropdown-empty {
  padding: 0.75rem;
  color: var(--ink-3);
  font-size: 0.85rem;
}

/* -- Custom dropdowns (period, facility) -- */

.bulk-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.bulk-dropdown-trigger:hover {
  border-color: var(--ink-3);
}
.bulk-dropdown-trigger:focus {
  outline: 0;
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px rgba(229, 183, 1, 0.18);
}
.bulk-dropdown-trigger--selected {
  border-color: var(--gold);
  font-weight: 600;
}
.bulk-dropdown-trigger--template {
  font-size: 0.8rem;
  padding: 0.3rem 0.5rem;
  white-space: nowrap;
}
.bulk-dropdown-trigger__arrow {
  font-size: 0.6rem;
  color: var(--ink-3);
  flex-shrink: 0;
}

.bulk-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 30;
  min-width: 220px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* -- Template dropdown -- */

.bulk-template-dropdown-wrap {
  position: relative;
}

.bulk-template-menu {
  right: 0;
  left: auto;
  min-width: 280px;
}

.bulk-template-save-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem;
  border-bottom: 1px solid var(--bg-2);
}

/* -- Form grid (2-column) -- */

.bulk-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .bulk-form-grid { grid-template-columns: 1fr; }
}

.bulk-form-half {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bulk-form-pair {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

.bulk-form-bottom-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid var(--bg-2);
}

.bulk-form-bottom-row .bulk-section__actions {
  flex: 1;
  align-self: flex-end;
}

.bulk-form-bottom-row .btn {
  padding: 0.2rem 0.65rem;
  font-size: 0.8rem;
  border-radius: 99px;
}

/* -- Time adder -- */

.bulk-chip--new {
  background: none;
  border: 1px dashed var(--silver);
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--ink-3);
  /* Match chip height exactly */
  height: 1.6rem;
  line-height: 1;
  padding: 0 0.5rem;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.bulk-chip--new:hover { border-color: var(--ink); color: var(--ink); }

.bulk-time-adder {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px dashed var(--silver);
  border-radius: 99px;
  padding: 0 0.4rem 0 0.5rem;
  /* Same height as chips */
  height: 1.6rem;
  flex-shrink: 0;
}

/* Smaller confirm checkmark */
.bulk-time-confirm.tg-btn--icon {
  width: 1.1rem;
  height: 1.1rem;
  font-size: 0.6rem;
  flex-shrink: 0;
}

/* -- Duration spinner -- */

.bulk-duration-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--ink-4);
  border-radius: 8px;
  overflow: hidden;
  max-width: 9rem;
}

.bulk-duration-wrap .bulk-duration-input {
  border: none;
  border-radius: 0;
  /* flex-basis: 0 + grow lets the input fill leftover space while
     keeping the spin buttons pinned to the right edge */
  flex: 1 1 0;
  width: 0;
  min-width: 0;
}

.bulk-duration-wrap .bulk-duration-input:hover,
.bulk-duration-wrap .bulk-duration-input:focus {
  box-shadow: none;
  outline: none;
}

.bulk-duration-wrap:hover,
.bulk-duration-wrap:focus-within {
  border-color: var(--silver);
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.15);
}

.bulk-duration-btns {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--ink-4);
}

.bulk-duration-btn {
  background: white;
  border: none;
  cursor: pointer;
  flex: 1;
  padding: 0 0.4rem;
  font-size: 0.45rem;
  line-height: 1;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.bulk-duration-btn:hover { background: var(--bg-2); color: var(--ink); }
.bulk-duration-btn:first-child { border-bottom: 1px solid var(--ink-4); }

/* -- Duration input (standalone, keep old class working) -- */

.bulk-duration-input {
  max-width: 6rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
  background: white;
}

/* -- Period add button -- */

.bulk-period-add-row {
  border-bottom: 1px solid var(--bg-2);
  margin-bottom: 0.25rem;
  padding-bottom: 0.25rem;
}

.bulk-period-add-btn {
  color: var(--gold-dark, #b8940a) !important;
  font-weight: 600 !important;
}

/* -- Template bar -- */

.bulk-template-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.bulk-match-count {
  font-size: 0.85rem;
  color: var(--ink-3);
  margin-top: 0.15rem;
}

/* -- Generated matches table -- */

.bulk-table-wrap {
  overflow-x: auto;
  padding: 0 1rem;
}

.bulk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

/* Canonical card-table header look (style guide) — applied here because the
   bulk modal IS the card surface (no separate .card wrapper). */
.bulk-table thead th {
  text-align: left;
  padding: 10px 12px;
  background: var(--surface-2);
  font-size: 0.77rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.bulk-table tbody td {
  border-top: 1px solid var(--line-2);
}
.bulk-table tbody tr:first-child td { border-top: 0; }
.bulk-table tbody tr:hover { background: var(--surface-2); }

.bulk-cell {
  padding: 0.45rem 0.75rem;
  vertical-align: middle;
  cursor: pointer;
  border-radius: 6px;
  white-space: nowrap;
}
.bulk-cell:hover { background: var(--silver-light); }

/* Native <input type="date"> needs more horizontal room than the formatted
   "Apr 30" display text, so reserve column width on the date column. */
.bulk-table th[data-sort-field="scheduled_date"],
.bulk-cell[data-field="scheduled_date"] { min-width: 9rem; }

.bulk-table-empty {
  text-align: center;
  padding: 2rem;
  color: var(--ink-3);
  font-size: 0.9rem;
}

/* -- Cell inline edit -- */

.bulk-cell-input {
  appearance: none;
  border: 1px solid var(--silver);
  border-radius: 6px;
  padding: 0.2rem 0.4rem;
  font-size: 0.875rem;
  background: white;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.bulk-cell-input:focus { outline: none; border-color: var(--gold); }

/* Apply to all — styled like a small pill button (similar to Clear) */
.bulk-apply-all {
  background: var(--ink-4);
  border: none;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  padding: 0.15rem 0.5rem;
}
.bulk-apply-all:hover { filter: brightness(93%); }

/* -- Pagination -- */

.bulk-pagination {
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--bg-2);
}

/* -- Sort indicators -- */

.bulk-th--sortable {
  cursor: pointer;
  user-select: none;
}
.bulk-th--sortable:hover { color: var(--ink); }

.bulk-th--asc::after  { content: " ↑"; font-size: 0.65rem; }
.bulk-th--desc::after { content: " ↓"; font-size: 0.65rem; }

/* -- Delete column -- */

.bulk-th--delete {
  width: 2rem;
}

.bulk-cell-delete {
  padding: 0.1rem 0.25rem;
  text-align: center;
  vertical-align: middle;
}

.bulk-row-delete {
  background: none;
  border: none;
  color: var(--ink-4);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
  transition: color 0.1s;
}
.bulk-row-delete:hover { color: var(--red, #d32f2f); }

/* -- Editing cell — absolute overlay so cell size never changes -- */

.bulk-cell--editing {
  /* Keep padding so row height matches non-editing cells */
  padding: 0.45rem 0.75rem;
  vertical-align: middle;
  position: relative;
}

.bulk-cell-edit-wrap {
  /* Fill the exact cell area without affecting layout */
  position: absolute;
  inset: 0;
  padding: 0.2rem 0.4rem;
  display: flex;
  align-items: center;
  background: white;
  z-index: 5;
  border-radius: 6px;
  box-shadow: 0 0 0 2px var(--gold);
}

/* -- Floating apply-all popup -- */

.bulk-apply-all-popup {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  z-index: 20;
  white-space: nowrap;
  pointer-events: auto;
}