/*  Voyages (voy-) — the tenant-wide overview + voyage detail with cargo parcels (VOY-2,
    stowage-plan concept §7). Feature layer: mds tokens only, linked after vessel-plan.css.
    Reuses vpl- primitives directly (input/panel-field/stepper-btn/danger/create-form) rather
    than duplicating them — a second-consumer case for eventual mds.css promotion, left as a
    feature-layer reuse for now (see docs/worklogs/voyages.md). */

/* ---- status chip ------------------------------------------------------- */

.voy-status {
    display: inline-block;
    padding: var(--mds-space-0-5) var(--mds-space-2);
    border-radius: var(--mds-radius);
    font-size: var(--mds-text-xs);
    font-weight: 700;
    margin-left: var(--mds-space-2);
}

.voy-status--draft { background: var(--mds-tint); color: var(--mds-muted); }
.voy-status--active { background: color-mix(in srgb, var(--mds-accent) 15%, var(--mds-surface)); color: var(--mds-accent-ink); }
.voy-status--completed { background: color-mix(in srgb, var(--mds-success) 15%, var(--mds-surface)); color: var(--mds-success); }

/* ---- typeahead (product/port pickers) ---------------------------------- */

.voy-typeahead {
    position: relative;
}

.voy-typeahead__list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 20;
    background: var(--mds-surface);
    border: 1px solid var(--mds-line);
    border-radius: var(--mds-radius-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
    padding: var(--mds-space-1) 0;
    max-height: 260px;
    overflow: auto;
}

.voy-typeahead__item {
    padding: var(--mds-space-1-5) var(--mds-space-3);
    cursor: pointer;
    font-size: var(--mds-text-sm);
    color: var(--mds-text);
}

.voy-typeahead__item.is-active { background: var(--mds-tint); }

/* ---- voyage header card -------------------------------------------------- */

.voy-header__body {
    display: flex;
    flex-direction: column;
    gap: var(--mds-space-3);
}

.voy-header__meta {
    font-size: var(--mds-text-sm);
    color: var(--mds-muted);
}

.voy-header__grid {
    display: grid;
    gap: var(--mds-space-3);
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .voy-header__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.voy-header__notes textarea { resize: vertical; }

/* Read-only wrapper for a Completed voyage: one disabled <fieldset> instead of per-input
   flags; display:contents removes its box so the header card's flex gap still applies to
   the grid and notes directly. */
.voy-fieldset {
    display: contents;
    border: 0;
    margin: 0;
    padding: 0;
}

.voy-header__actions {
    display: flex;
    gap: var(--mds-space-2);
}

/* ---- parcel table -------------------------------------------------------- */

.voy-parcels__heading {
    margin: 0;
    font-size: var(--mds-text-lg);
    color: var(--mds-title);
    flex: 1;
}

.voy-parcels-scroll {
    overflow-x: auto;
}

.voy-parcels { min-width: 900px; }

.voy-parcels th, .voy-parcels td { font-size: var(--mds-text-sm); white-space: nowrap; }

.voy-parcel__actions {
    display: flex;
    align-items: center;
    gap: var(--mds-space-1);
    white-space: nowrap;
}

.voy-parcel__error td { padding-top: 0; }

/* Compact inputs sized for a table cell, layered on top of .vpl-input. */
.voy-cell-input { width: 140px; }
.voy-cell-input--num { width: 80px; }

/* ---- add-parcel inline form ---------------------------------------------- */

.voy-addparcel { margin-bottom: var(--mds-space-3); }
