/* SPDX-FileCopyrightText: 2026 David Dalzell */
/* SPDX-License-Identifier: MIT */

/* Waybills tab — waybill pool list, slot assignment rows, and the
   create/edit waybill dialog. */

/* ── Waybill cards ───────────────────────────────────────────────────────── */
.waybill-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.waybill-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  background: var(--pico-card-background-color, #f9f9f9);
  border: 1px solid transparent;
  font-size: 0.9rem;
}

.waybill-row.active-slot {
  border-color: var(--rail-accent);
  background: var(--rail-accent-bg);
}

.slot-num {
  font-weight: bold;
  min-width: 1.5rem;
  color: var(--text-muted);
}

.industry-tag {
  margin-left: auto;
  font-size: 0.75rem;
  background: var(--badge-green);
  color: white;
  border-radius: 999px;
  padding: 2px 8px;
  min-width: 110px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Waybill editor dialog ───────────────────────────────────────────────── */
#waybill-dialog article {
  max-width: 720px;
  max-height: 85vh;
  overflow-y: auto;
}

.waybill-slot {
  border: 1px solid var(--border-light);
  border-radius: var(--card-radius);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.waybill-slot.active-slot {
  border-color: var(--rail-accent);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.we-empty-label {
  align-self: flex-end;
  padding-bottom: 0.5rem;
}

/* ── Waybill pool ────────────────────────────────────────────────────────── */
.pool-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.9rem;
}

.pool-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pool-item-meta { white-space: nowrap; }

.pool-item-actions {
  display: flex;
  gap: 0.25rem;
}

/* ── Slot assignment rows ────────────────────────────────────────────────── */
.slot-assign-row {
  display: grid;
  grid-template-columns: 2rem 1fr;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  margin-bottom: 0.4rem;
  background: var(--pico-card-background-color, #f9f9f9);
  border: 1px solid transparent;
}

.slot-assign-row.active-slot {
  border-color: var(--rail-accent);
  background: var(--rail-accent-bg);
}

.slot-picker { margin-bottom: 0; }

/* ── Mobile (≤ 600px) ────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  /* Waybill pool — info on top row, meta below, actions span both rows */
  .pool-item {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }

  .pool-item-meta {
    grid-column: 1;
    grid-row: 2;
  }

  .pool-item-actions {
    grid-row: 1 / 3;
    align-self: center;
  }
}
