/* assign 画面 専用スタイル */

.assign-date-nav {
  display: flex; gap: 10px; align-items: center;
  background: #fff; border-radius: 10px; padding: 10px 14px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.assign-date-nav label { font-size: 13px; color: #3d5670; font-weight: 600; }
.assign-date-nav input[type=date] {
  padding: 6px 10px; border: 1.5px solid #c5dff0; border-radius: 6px;
  font-size: 15px; color: #1a3a5c; background: #f5f9ff;
  flex: 1; max-width: 200px;
}

.assign-toolbar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  background: #fff; border-radius: 10px; padding: 10px 14px;
  margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.assign-counter {
  font-size: 13px; color: #3d5670; margin-left: auto;
}

.assign-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.assign-grid > .lane--unassigned { grid-column: 1 / -1; }

.lane {
  background: #fff; border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  overflow: hidden;
  display: flex; flex-direction: column;
  min-height: 140px;
}
.lane__header {
  padding: 10px 12px;
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 700; font-size: 14px;
  transition: background .2s;
}
.lane__header--gray { background: #e5e7eb; color: #374151; }

.lane__settings {
  border-bottom: 1px solid #e8f2f9;
  padding: 8px 10px;
  display: flex; flex-direction: column; gap: 6px;
  background: #f7fafc;
}
.lane__settings-row {
  display: flex; align-items: center; gap: 6px;
}
.lane__settings select {
  flex: 1; min-width: 0;
  padding: 5px 8px; border: 1px solid #c5dff0; border-radius: 5px;
  font-size: 14px; color: #1a3a5c; background: #fff;
}
.lane__fish-btn {
  font-size: 12px; padding: 4px 10px;
  background: #f0f7ff; border: 1.5px solid #0077b6; color: #0077b6;
  border-radius: 16px; cursor: pointer; white-space: nowrap;
}
.lane__fish-name {
  font-size: 11px; color: #1a3a5c; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1;
}
.lane__crew-btn {
  font-size: 12px; padding: 4px 10px;
  background: #f0fff4; border: 1.5px solid #2e7d32; color: #2e7d32;
  border-radius: 16px; cursor: pointer; white-space: nowrap;
}
.lane__crew-tags {
  display: inline-flex; flex-wrap: wrap; gap: 4px;
  flex: 1; min-width: 0;
}
.lane__crew-tag {
  display: inline-block; padding: 2px 8px;
  border-radius: 12px; font-size: 11px; font-weight: 600;
}
.lane__charter-cb {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; color: #1a3a5c;
  white-space: nowrap;
}
.lane__charter-cb input { width: 16px; height: 16px; accent-color: #f59e0b; }

.lane__body {
  flex: 1; padding: 8px;
  min-height: 100px;
  transition: background .15s;
  display: flex; flex-direction: column; gap: 6px;
}
.lane__body.drag-over { background: #dbeafe; }
.lane__body--empty {
  color: #5f7995; font-size: 12px; text-align: center; padding: 24px 8px;
}

.lane.is-over-capacity .lane__header { background: #e53935 !important; color: #fff !important; }

.assign-card {
  background: #fff;
  border: 1.5px solid #c5dff0;
  border-radius: 6px;
  padding: 8px 10px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: box-shadow .15s, transform .1s;
}
.assign-card:active { cursor: grabbing; }
.assign-card.dragging { opacity: .4; transform: scale(.97); }
.assign-card.charter-mark { border-left: 3px solid #f59e0b; background: #fffbeb; }
.assign-card__name { font-weight: 700; font-size: 14px; color: #1a3a5c; }
.assign-card__meta { font-size: 11px; color: #3d5670; margin-top: 2px; }

.assign-save-bar {
  position: sticky; bottom: 0;
  background: #fff; border-top: 1px solid #e8f2f9;
  padding: 12px 14px; display: flex; gap: 10px; justify-content: flex-end;
  box-shadow: 0 -2px 8px rgba(0,0,0,.06);
  margin: 0 -14px;
}

.lane.is-disabled { opacity: .4; pointer-events: none; }

/* 警告バナー (船長不足 / 未割り振り) */
.assign-alert {
  background: #fff3cd; border: 1.5px solid #f59e0b; border-radius: 8px;
  padding: 10px 14px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: #92400e;
}

/* 未割り振りカードのアコーディオン */
.assign-card__head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.assign-card__toggle {
  background: none; border: 0; color: #3d5670; cursor: pointer;
  padding: 4px 6px; font-size: 12px;
}
.assign-card__detail {
  display: none; margin-top: 6px; padding-top: 6px;
  border-top: 1px dashed #c5dff0;
  font-size: 11px; color: #1a3a5c;
}
.assign-card__detail.is-open { display: block; }
.assign-card__detail > div { margin-bottom: 2px; }
.assign-card__detail .empty { color: #5f7995; }

/* 全未割り振り一覧 (確定ボタン下) */
#assign-global-unassigned {
  margin-top: 16px; background: #fff; border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08); overflow: hidden;
}
#assign-global-unassigned .agu-header {
  padding: 10px 14px; background: #fee2e2; color: #991b1b;
  font-weight: 700; font-size: 14px;
  display: flex; align-items: center; gap: 8px;
}
#assign-global-unassigned .agu-row {
  padding: 10px 14px; border-bottom: 1px solid #f0f0f0;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; transition: background .1s;
}
#assign-global-unassigned .agu-row:hover { background: #f5f9ff; }
#assign-global-unassigned .agu-row__date { font-size: 12px; color: #3d5670; margin-right: 8px; }
#assign-global-unassigned .agu-row__name { font-weight: 600; color: #1a3a5c; }
#assign-global-unassigned .agu-row__charter { font-size: 11px; color: #f59e0b; margin-left: 4px; }
#assign-global-unassigned .agu-row__action { font-size: 12px; color: #0077b6; white-space: nowrap; }

/* 30日 outlook */
#assign-outlook .cp-section-header {
  display: flex; align-items: center; justify-content: space-between;
}
#outlook-wrap .ol-day {
  border: 1px solid #e7edf3; border-radius: 8px;
  padding: 10px 12px; background: #fff; margin-bottom: 10px;
}
#outlook-wrap .ol-day.is-holiday { background: #f3f4f6; }
#outlook-wrap .ol-day__head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap;
}
#outlook-wrap .ol-day__date  { font-size: 14px; font-weight: 700; color: #1a3a5c; }
#outlook-wrap .ol-day__dow   { font-weight: 700; }
#outlook-wrap .ol-day__count { margin-left: auto; font-size: 11px; color: #3d5670; }
#outlook-wrap .ol-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-top: 1px dashed #eef2f7; flex-wrap: wrap;
}
#outlook-wrap .ol-row__ship { font-weight: 700; min-width: 80px; }
#outlook-wrap .ol-row select {
  padding: 3px 6px; border: 1px solid #d7e2ed; border-radius: 4px; font-size: 12px;
}
#outlook-wrap .ol-row label { display: flex; align-items: center; gap: 3px; font-size: 12px; }

/* 新規予約ポップアップ (右からスライドイン、下半分、上方向スワイプで dismiss) */
.new-booking-popup {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 100%;
  max-width: 480px;
  height: 50vh;
  z-index: 9500;
  pointer-events: auto;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.new-booking-popup.is-open {
  transform: translateX(0);
}
.new-booking-popup.is-dismissing {
  transition: transform .25s ease;
  transform: translateY(110%);
}
.new-booking-popup__inner {
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 32px rgba(0,0,0,.18);
  height: 100%;
  display: flex; flex-direction: column;
  overflow: hidden;
  touch-action: pan-y;
}
.new-booking-popup__grip {
  width: 40px; height: 4px;
  background: #c5dff0; border-radius: 2px;
  margin: 8px auto 4px;
  flex-shrink: 0;
}
.new-booking-popup__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px 10px;
  border-bottom: 1px solid #e8f2f9;
  flex-shrink: 0;
}
.new-booking-popup__title { font-size: 15px; font-weight: 700; color: #023e6e; }
.new-booking-popup__close {
  background: none; border: 0;
  width: 32px; height: 32px;
  font-size: 20px; color: #5f7995;
  cursor: pointer; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.new-booking-popup__close:hover { background: #f0f7fc; color: #023e6e; }
.new-booking-popup__body {
  flex: 1; overflow-y: auto;
  padding: 14px 16px;
}
.new-booking-popup__foot {
  flex-shrink: 0;
  text-align: center;
  font-size: 11px; color: #5f7995;
  padding: 6px 16px 10px;
}
.nb-row { display:flex; gap:8px; padding:6px 0; border-bottom:1px solid #f0f7fc; font-size:14px; }
.nb-row:last-child { border-bottom:none; }
.nb-row__label { min-width:80px; color:#5f7995; font-size:12px; }
.nb-row__value { color:#1a3a5c; font-weight:600; flex:1; word-break:break-all; }
.nb-actions { margin-top:12px; display:flex; gap:8px; }

/* タップで割り振り (3隻以上モード): 縦1列で並べる
   admin.css の `.assign-grid { 1fr 1fr !important; }` を上書きするため !important */
.assign-grid.is-tap-mode { grid-template-columns: 1fr !important; }
.assign-card.is-tappable { cursor: pointer; touch-action: auto; }
.assign-card.is-tappable:hover { box-shadow: 0 2px 8px rgba(0,119,182,.15); border-color: #0077b6; }
.picker-meta {
  font-size: 13px; color: #3d5670; margin-bottom: 14px;
  padding: 10px; background: #f5f9ff; border-radius: 6px;
}
.picker-meta b { color: #1a3a5c; }
.picker-buttons { display: flex; flex-direction: column; gap: 8px; }
.picker-buttons button {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-radius: 8px;
  border: 1.5px solid #c5dff0; background: #fff;
  font-size: 15px; font-weight: 700; color: #1a3a5c;
  cursor: pointer; transition: background .1s, transform .05s;
}
.picker-buttons button:hover:not(.is-current):not(:disabled) { background: #f0f7ff; }
.picker-buttons button:active { transform: scale(.98); }
.picker-buttons button.is-current {
  background: #e5e7eb; color: #6b7280; cursor: default;
}
.picker-buttons button:disabled {
  opacity: .5; cursor: not-allowed;
}
.picker-buttons button .picker-btn__cap {
  font-size: 12px; font-weight: 600; color: #3d5670;
}

@media (max-width: 600px) {
  .assign-grid { grid-template-columns: 1fr; }
}
