/* Crew Management — Roster, documents with expiry, vessel assignments */

.crew-section-wrap {
  margin-top: 0.5rem;
}

.crew-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  min-width: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.crew-toolbar > * { flex-shrink: 0; }

@media (max-width: 768px) {
  .crew-toolbar { gap: 0.65rem; }
  .crew-metrics { flex-wrap: nowrap; overflow-x: auto; }
  .crew-metric { white-space: nowrap; flex-shrink: 0; }
}

.crew-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.crew-metric {
  font-size: 0.875rem;
  color: var(--text-secondary, #555);
}

#crew-roster-tbody tr[data-id] {
  cursor: pointer;
}

#crew-roster-tbody tr[data-id]:hover {
  background: #f8f9fa;
}

.crew-expiry-alerts {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 4px solid #0b6bcb;
}

.crew-expiry-alerts .panel-title {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
}

.crew-expiry-item {
  font-size: 0.85rem;
  padding: 0.25rem 0;
}

.crew-alert--expired {
  color: #c2410c;
  font-weight: 600;
}

.crew-alert--warn {
  color: #c2410c;
}

.crew-alert--info {
  color: #0b6bcb;
}

.crew-doc-expired {
  color: #c2410c;
  font-weight: 600;
}

.crew-doc-warn {
  color: #c2410c;
}

.crew-doc-info {
  color: #0b6bcb;
}

.crew-detail-wrap {
  margin-top: 0.5rem;
}

.crew-detail-wrap .panel-title {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
}

.crew-detail-wrap .table-wrap {
  margin-top: 0.5rem;
}

.crew-detail-panel {
  margin-bottom: 1.5rem;
}

.crew-detail-panel .panel-title {
  margin-bottom: 0.5rem;
}

.crew-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.crew-modal {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  max-width: 720px;
  width: 92%;
  max-height: 90vh;
  overflow: auto;
}

.crew-modal-title {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  grid-column: 1 / -1;
}

.crew-modal-body {
  padding: 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.crew-modal-body .form-group {
  margin-bottom: 0;
}

.crew-modal-body .form-group.full-width,
.crew-modal-body .form-row {
  grid-column: 1 / -1;
}

.crew-modal-body .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.crew-modal-actions {
  padding: 1rem 1.25rem;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.crew-profile-root {
  margin-bottom: 1.25rem;
}

.crew-profile-section {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.crew-profile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.crew-profile-section .panel-title {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #667;
}

.crew-profile-section-head .panel-title {
  margin: 0;
}

.crew-personal-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.25rem;
}

.crew-photo-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.crew-profile-photo {
  width: 148px;
  height: 148px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e2e5ea;
  background: #f3f4f6;
}

.crew-profile-photo--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #889;
  font-size: 0.85rem;
}

.crew-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.crew-personal-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 1rem;
}

.crew-field {
  min-width: 0;
}

.crew-field--wide {
  grid-column: 1 / -1;
}

.crew-field-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7a8290;
  margin-bottom: 0.15rem;
}

.crew-field-value {
  display: block;
  font-size: 0.95rem;
  color: #1f2937;
  word-break: break-word;
}

.crew-field-empty {
  color: #a0a7b2;
}

.crew-profile-subgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.crew-roster-name-cell {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.crew-roster-thumb {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #e5e7eb;
}

.crew-roster-thumb--empty {
  display: inline-block;
  background: #eef1f5;
}

@media (max-width: 900px) {
  .crew-personal-grid {
    grid-template-columns: 1fr;
  }
  .crew-profile-subgrid {
    grid-template-columns: 1fr;
  }
  .crew-modal-body .form-row {
    grid-template-columns: 1fr;
  }
}
