/* ==========================================================
   Bills of Lading — Vessel Manifest cards
   Each vessel group becomes a port-ledger style card with
   a navy header band and refined BL rows beneath.
   ========================================================== */

.vessel-manifest {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(var(--bs-primary-rgb), 0.04);
  overflow: hidden;
  margin-bottom: 1rem;
  border: 1px solid rgba(var(--bs-primary-rgb), 0.10);
}

/* --- Header (light) --- */
.vessel-manifest__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #fafbfd;
  border-bottom: 1px solid rgba(var(--bs-primary-rgb), 0.08);
}

.vessel-manifest__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(var(--bs-primary-rgb), 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--bs-body-emphasis-color);
}

.vessel-manifest__icon svg {
  width: 18px;
  height: 18px;
}

.vessel-manifest__title-block {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.625rem;
}

.vessel-manifest__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--bs-body-emphasis-color);
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.vessel-manifest__cargo-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  background: rgba(var(--bs-primary-rgb), 0.06);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--bs-body-emphasis-color);
  line-height: 1.4;
}

.vessel-manifest__cargo-pill .bi {
  font-size: 0.7rem;
  opacity: 0.7;
}

.vessel-manifest__cargo-pill--missing {
  background: rgba(var(--bs-danger-rgb), 0.08);
  color: var(--bs-danger-hover);
}

.vessel-manifest__cargo-pill--missing .bi {
  opacity: 1;
  color: var(--bs-danger);
}

.vessel-manifest__count {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  color: var(--bs-secondary-color);
}

.vessel-manifest__count-num {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--bs-body-emphasis-color);
  line-height: 1;
}

.vessel-manifest__count-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--bs-secondary-color);
  line-height: 1;
}

/* --- Body --- */
.vessel-manifest__body {
  padding: 0.25rem 0;
}

.vessel-manifest__bl {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  padding: 1rem 1.25rem;
  position: relative;
  border-top: 1px solid rgba(var(--bs-primary-rgb), 0.06);
  transition: background-color 0.15s ease;
}

.vessel-manifest__bl:first-child {
  border-top: none;
}

.vessel-manifest__bl:hover {
  background-color: rgba(var(--bs-primary-rgb), 0.02);
}

/* On desktop, the inner row is "transparent" so its children become
   direct flex items of the BL row. On mobile, this gets overridden
   to be its own flex row stacked above the actions. */
.vessel-manifest__bl-row {
  display: contents;
}

.vessel-manifest__bl-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(var(--bs-info-rgb), 0.10);
  color: var(--bs-body-emphasis-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
  align-self: flex-start;
}

.vessel-manifest__bl-content {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.vessel-manifest__bl-number {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--bs-body-emphasis-color);
  line-height: 1.3;
  word-break: break-all;
}

.vessel-manifest__bl-file {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  flex-wrap: wrap;
}

.vessel-manifest__bl-file-name {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #4a4e69;
}

.vessel-manifest__bl-file-size {
  font-size: 0.7rem;
  color: var(--bs-secondary-color);
  font-variant-numeric: tabular-nums;
}

.vessel-manifest__bl-dates {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  font-size: 0.7rem;
  color: var(--bs-secondary-color);
  flex-wrap: wrap;
  margin-top: 0.125rem;
}

.vessel-manifest__bl-date {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.vessel-manifest__bl-date-icon {
  font-size: 0.75rem;
  color: var(--bs-tertiary-color);
}

.vessel-manifest__bl-date-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  font-size: 0.625rem;
  color: var(--bs-secondary-color);
}

.vessel-manifest__bl-date-value {
  font-variant-numeric: tabular-nums;
  color: #4a4e69;
}

.vessel-manifest__bl-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

/* --- Mobile (< 768px) --- */
@media (max-width: 767.98px) {
  .vessel-manifest {
    border-radius: 10px;
    margin-bottom: 1rem;
  }

  .vessel-manifest__header {
    padding: 0.625rem 0.875rem;
    gap: 0.625rem;
  }

  .vessel-manifest__icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
  }

  .vessel-manifest__icon svg {
    width: 16px;
    height: 16px;
  }

  .vessel-manifest__title {
    font-size: 0.875rem;
  }

  .vessel-manifest__bl {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
  }

  .vessel-manifest__bl-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
  }

  .vessel-manifest__bl-actions {
    width: 100%;
  }

  .vessel-manifest__bl-actions .btn {
    flex-grow: 1;
  }
}
