/* ============================================================================
 * 183 PWA — voyages.css
 * Split from the original single-file PWA. See styles/README.md for the
 * full layout map.
 * ========================================================================== */



/* ============================================================================
   Voyage cards
   ========================================================================== */

.voyage-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.voyage-card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: all 160ms ease;
  cursor: pointer;
  text-align: left;
  width: 100%;
  position: relative;
}

.voyage-card:active { transform: scale(0.99); }
.voyage-card:hover { border-color: var(--line-strong); }
.voyage-card.planned {
  border-color: rgba(255, 184, 77, 0.24);
  background: linear-gradient(180deg, rgba(255, 184, 77, 0.04), transparent);
}
.voyage-card.active {
  border-color: var(--line-glow);
  background: linear-gradient(180deg, rgba(0, 224, 255, 0.05), transparent);
}

.voyage-card .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.voyage-card .vessel {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
}

.voyage-card .badge {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 3px 7px;
  border-radius: 3px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.voyage-card .badge.past { background: transparent; color: var(--text-faint); }
.voyage-card .badge.active { color: var(--accent); border-color: var(--line-glow); }
.voyage-card .badge.planned { color: var(--signal); border-color: rgba(255, 184, 77, 0.3); background: var(--signal-faint); }
.voyage-card .badge.holiday { color: var(--text-soft); }

.voyage-card .route {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
  color: var(--text-soft);
}

.voyage-card .route .arrow {
  color: var(--accent);
  font-weight: 500;
}

.voyage-card .dates {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.voyage-card .pill {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-faint);
  padding: 3px 7px;
  border-radius: 3px;
  letter-spacing: 0.04em;
}
.voyage-card .pill.signal { color: var(--signal); background: var(--signal-faint); }



/* ============================================================================
   Trip summary card — shown at the top of the trip edit sheet when
   editing an existing trip. Gives at-a-glance info before fields below.
   ========================================================================== */
.trip-summary-card {
  margin: 0 0 18px;
  padding: 14px 16px;
  background: var(--bg-base);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  border-left: 3px solid var(--accent);
}
.trip-summary-row1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.trip-summary-name {
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trip-summary-dates {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.trip-summary-meta {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Evidence placeholder rows — disabled, marked SOON */
.evidence-placeholder {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.evidence-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-base);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.evidence-row.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.evidence-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.evidence-icon svg { width: 22px; height: 22px; }
.evidence-body {
  flex: 1;
  min-width: 0;
}
.evidence-title {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 2px;
}
.evidence-sub {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.soon-pill {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  padding: 3px 8px;
  border: 1px solid var(--signal);
  color: var(--signal);
  border-radius: 100px;
  background: var(--signal-faint);
}

/* Generic pill — used in the trip summary card */
.trip-summary-row1 .pill {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  padding: 3px 9px;
  border-radius: 100px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--line-strong);
  flex-shrink: 0;
}
.trip-summary-row1 .pill.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-faint);
}
.trip-summary-row1 .pill.planned {
  color: var(--accent);
  border-color: rgba(0, 224, 255, 0.4);
  background: var(--accent-faint);
}
.trip-summary-row1 .pill.holiday {
  color: var(--signal);
  border-color: var(--signal);
  background: var(--signal-faint);
}



/* ============================================================================
   Trip Detail sheet — peek before edit. Tapping a populated day or voyage
   card opens this sheet showing the trip at a glance with per-day evidence
   slots. The "Edit trip" button at the bottom opens the editor.
   ========================================================================== */

.trip-detail {
  /* No fixed sizing — sheet handles its own height */
}

.trip-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.trip-detail-name {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trip-detail-header .pill {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--line-strong);
  flex-shrink: 0;
}
.trip-detail-header .pill.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-faint);
  box-shadow: 0 0 8px var(--accent-faint);
}
.trip-detail-header .pill.planned {
  color: var(--accent);
  border-color: rgba(0, 224, 255, 0.4);
  background: var(--accent-faint);
}
.trip-detail-header .pill.holiday {
  color: var(--signal);
  border-color: var(--signal);
  background: var(--signal-faint);
}

.trip-detail-dates {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--text-soft);
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}
.trip-detail-days {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}

/* Meta — a compact key/value list */
.trip-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--bg-base);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: 14px;
}
.trip-detail-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 0.84rem;
}
.trip-detail-meta-k {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
}
.trip-detail-meta-v {
  color: var(--text);
  font-weight: 500;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tax-meaning line — a one-line context box */
.trip-detail-meaning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--accent-faint);
  border: 1px solid rgba(0, 224, 255, 0.2);
  border-radius: var(--r-md);
  margin-bottom: 14px;
}
.trip-detail-meaning-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  padding-top: 1px;
}
.trip-detail-meaning-text {
  flex: 1;
  font-size: 0.84rem;
  color: var(--text-soft);
  line-height: 1.45;
}

/* Notes (read-only) */
.trip-detail-notes {
  margin-bottom: 14px;
}
.trip-detail-section-label {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}
.trip-detail-section-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.trip-detail-notes-body {
  padding: 10px 14px;
  background: var(--bg-base);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--text-soft);
  font-size: 0.86rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Evidence section */
.trip-detail-evidence {
  margin-top: 6px;
  margin-bottom: 8px;
}

/* Planned-voyage evidence placeholder (PWA-034). Replaces the per-day
   list when the voyage hasn't started yet — there's nothing to log,
   nothing to attach. Soft, informational tone. */
.trip-detail-evidence-placeholder {
  margin-top: 8px;
  padding: 16px 14px;
  background: var(--bg-base);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm, 6px);
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.5;
  text-align: center;
}
.evidence-day-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

/* PWA-035: evidence-day-row is now a button (tap to bounce to calendar
   editor). Reset native button styles so it reads as a row. */
.evidence-day-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-base);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  text-align: left;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  width: 100%;
  transition: background 0.12s, border-color 0.12s;
}
.evidence-day-row:hover {
  background: var(--bg-elevated);
  border-color: var(--line-strong);
}
.evidence-day-row.has-position {
  border-color: var(--line-strong);
}

.evidence-day-date {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-soft);
  letter-spacing: 0.04em;
  min-width: 60px;
}

.evidence-day-pos {
  flex: 1 1 auto;
  font-size: 0.82rem;
  color: var(--text-soft);
}
.evidence-day-row.has-position .evidence-day-pos {
  color: var(--text);
}

.evidence-day-arrow {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Legacy slot styling kept for any older code paths still using it.
   The new evidence list (PWA-035) doesn't render these. */
.evidence-day-slots {
  display: flex;
  gap: 6px;
}
.evidence-slot {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 120ms;
}
.evidence-slot svg { width: 14px; height: 14px; }
.evidence-slot.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.evidence-slot:not(.disabled):hover {
  border-color: var(--accent);
  color: var(--accent);
  border-style: solid;
}

/* Long-trip evidence summary — shown instead of a per-day list when the
   trip is more than 14 days long, to avoid overwhelming the sheet */
.evidence-summary {
  padding: 14px 16px;
  background: var(--bg-base);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.evidence-summary-line {
  font-family: var(--mono);
  font-size: 0.84rem;
  color: var(--text-soft);
  margin-bottom: 6px;
}
.evidence-summary-help {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.5;
}



/* ============================================================================
   Lapse warning sheet — shown when the user attempts to save a trip that
   starts after the projected fail date of their existing period. Informs
   them the previous period has lapsed and this trip starts a fresh window.
   Not blocking — they can choose to save anyway.
   ========================================================================== */

.lapse-warning-icon {
  display: flex;
  justify-content: center;
  color: var(--signal);
  margin-bottom: 8px;
}
.lapse-warning-icon svg { width: 48px; height: 48px; }

.lapse-warning-body {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-soft);
  text-align: center;
  margin: 0 6px 14px;
}
.lapse-warning-body strong {
  color: var(--text);
  font-weight: 600;
}

.lapse-warning-meaning {
  padding: 12px 14px;
  background: var(--signal-faint);
  border: 1px solid rgba(255, 184, 77, 0.3);
  border-radius: var(--r-md);
  margin-bottom: 14px;
}
.lapse-warning-meaning-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--signal);
  margin-bottom: 6px;
}
.lapse-warning-meaning-body {
  font-size: 0.84rem;
  color: var(--text-soft);
  line-height: 1.5;
}

.lapse-warning-stats {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}
.lapse-warning-stat {
  flex: 1;
  padding: 10px;
  background: var(--bg-base);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  text-align: center;
}
.lapse-warning-stat-k {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.lapse-warning-stat-v {
  font-family: var(--display);
  font-size: 1.2rem;
  color: var(--text);
  font-weight: 600;
}

/* Fresh-start ribbon on the voyage card — small, top-of-card amber strip
   indicating that this trip began a new 365-day claim period after a
   previous lapse. */
.fresh-start-ribbon {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  margin: -14px -14px 10px;
  background: var(--signal-faint);
  border-bottom: 1px solid rgba(255, 184, 77, 0.25);
  border-radius: var(--r-md) var(--r-md) 0 0;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--signal);
}
.fresh-start-ribbon svg { width: 12px; height: 12px; }

/* Fresh-start callout in the trip detail sheet — a more prominent panel
   so when the user peeks at the trip they see why it's special. */
.trip-detail-fresh-start {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--signal-faint);
  border: 1px solid rgba(255, 184, 77, 0.3);
  border-left: 3px solid var(--signal);
  border-radius: var(--r-md);
}
.trip-detail-fresh-start-icon {
  flex-shrink: 0;
  color: var(--signal);
  display: flex;
  align-items: flex-start;
  padding-top: 2px;
}
.trip-detail-fresh-start-icon svg { width: 22px; height: 22px; }
.trip-detail-fresh-start-body {
  flex: 1;
}
.trip-detail-fresh-start-title {
  font-weight: 600;
  color: var(--signal);
  font-size: 0.9rem;
  margin-bottom: 4px;
}
.trip-detail-fresh-start-sub {
  font-size: 0.78rem;
  color: var(--text-soft);
  line-height: 1.45;
}

/* Existing planned voyages shown in the plan list — distinguished from
   planner-suggested ones so the user can tell at a glance which trips
   are already on their calendar vs. which the planner is recommending. */
.plan-voyage-existing {
  border-style: dashed;
  opacity: 0.85;
}
.plan-voyage-existing .vessel { color: var(--text-soft); }


/* ============================================================================
 * PWA-035 — Voyage evidence sheet (master Add Evidence button target)
 *
 * Per-voyage attachments: signed midnight log, travel stubs, flight records,
 * DBC scans, etc. v1 stores metadata only — actual file upload backend
 * is a later integration.
 * ========================================================================== */

.evidence-sheet {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 12px;
}

.evidence-sheet-header {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.evidence-sheet-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}
.evidence-sheet-sub {
  margin-top: 2px;
}

.evidence-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.evidence-list-empty {
  padding: 16px 12px;
  background: var(--bg-base);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm);
  text-align: center;
  font-style: italic;
}

.evidence-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

.evidence-row-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.evidence-row-kind {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.evidence-row-filename {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text);
  word-break: break-all;
}

.evidence-row-description {
  margin-top: 2px;
  line-height: 1.4;
}

.evidence-row-timestamp {
  margin-top: 4px;
}

.evidence-row-delete {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 120ms;
}
.evidence-row-delete:hover {
  border-color: var(--bad);
  color: var(--bad);
}

/* Add-evidence form */
.evidence-add-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--bg-base);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
}

.evidence-add-form-title {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.evidence-add-form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.evidence-add-form-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.evidence-add-form-hint {
  margin-top: -2px;
  line-height: 1.4;
  font-style: italic;
}

