/*
 * SCR-25 반입/반출 도크 슬롯 예약 [M8] 전용 스타일.
 * design.md §1 토큰만 참조. shared.css 프리미티브(kx-page·kx-card·kx-seg·kx-select·kx-bi__degraded) 위에 얹는다.
 * 클래스는 kx-dock__* 로 네임스페이스.
 */
@import '../shared.css';

.kx-dock__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.kx-dock__title {
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
  color: var(--color-neutral-900);
}
.kx-dock__subtitle {
  margin-top: 2px;
  font-size: var(--fs-body);
  color: var(--color-neutral-500);
}
.kx-dock__head-badges {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* ── 필터 바 ── */
.kx-dock__filters {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.kx-dock__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kx-dock__label {
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  color: var(--color-neutral-500);
}
.kx-dock__filters-spacer {
  flex: 1;
}

/* ── 2열 split ── */
.kx-dock__split {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: var(--space-4);
  align-items: start;
}
@media (max-width: 1200px) {
  .kx-dock__split {
    grid-template-columns: 1fr;
  }
}

/* ── 스케줄 그리드 ── */
.kx-dock__grid {
  padding: 0;
  overflow: hidden;
}
.kx-dock__grid-scroll {
  overflow-x: auto;
}
.kx-dock__ghead,
.kx-dock__row {
  display: flex;
  min-width: 720px;
}
.kx-dock__ghead {
  background: var(--color-neutral-050);
  border-bottom: var(--border-card);
}
.kx-dock__ghead-dock {
  width: 72px;
  flex-shrink: 0;
  padding: 10px;
  text-align: center;
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  color: var(--color-neutral-500);
  border-right: 1px solid var(--color-neutral-100);
  display: flex;
  align-items: center;
  justify-content: center;
}
.kx-dock__times {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
}
.kx-dock__time {
  padding: 10px 2px;
  text-align: center;
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  color: var(--color-neutral-500);
  border-right: 1px solid var(--color-neutral-100);
}
.kx-dock__time:last-child {
  border-right: none;
}
.kx-dock__row {
  border-bottom: 1px solid var(--color-neutral-100);
}
.kx-dock__row:last-child {
  border-bottom: none;
}
.kx-dock__row-label {
  width: 72px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  color: var(--color-primary-700);
  border-right: 1px solid var(--color-neutral-100);
  background: var(--color-neutral-050);
}
.kx-dock__cells {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  height: 60px;
}
.kx-dock__cell {
  border-right: 1px solid var(--color-neutral-100);
  cursor: pointer;
  transition: background 0.12s ease;
}
.kx-dock__cell:hover {
  background: var(--color-primary-050);
}
.kx-dock__cell.is-selected {
  background: var(--color-primary-100);
  outline: 2px solid var(--color-primary-600);
  outline-offset: -2px;
}
.kx-dock__block {
  margin: 4px 2px;
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: var(--fs-micro);
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
}
.kx-dock__block--booked {
  background: var(--color-primary-600);
  color: var(--color-on-accent);
}
.kx-dock__block--priority {
  background: var(--color-violation-warn-bg);
  color: var(--color-violation-warn-text);
  font-weight: var(--fw-bold);
  border: 1px solid var(--color-violation-warn);
}
.kx-dock__block-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kx-dock__legend {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
  border-top: var(--border-card);
  font-size: var(--fs-caption);
  color: var(--color-neutral-500);
}
.kx-dock__legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.kx-dock__swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}
.kx-dock__swatch--booked {
  background: var(--color-primary-600);
}
.kx-dock__swatch--priority {
  background: var(--color-violation-warn);
}
.kx-dock__swatch--open {
  border: 1px solid var(--color-neutral-200);
  background: var(--color-white);
}

/* ── 우측 예약 폼 ── */
.kx-dock__aside {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.kx-dock__panel-title {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-h3);
  color: var(--color-primary-700);
  padding-bottom: 6px;
  border-bottom: 2px solid var(--color-primary-600);
  margin-bottom: var(--space-4);
}
.kx-dock__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.kx-dock__input,
.kx-dock__select {
  height: 40px;
  padding: 0 var(--space-3);
  border: var(--border-card);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  font-size: var(--fs-body);
  color: var(--color-neutral-900);
  width: 100%;
  font-family: inherit;
}
.kx-dock__input:focus,
.kx-dock__select:focus {
  outline: 2px solid var(--color-primary-100);
  border-color: var(--color-primary-600);
}
.kx-dock__check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-body);
  color: var(--color-neutral-700);
  cursor: pointer;
}
.kx-dock__slot-note {
  font-size: var(--fs-caption);
  color: var(--color-neutral-500);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--color-primary-050);
  color: var(--color-primary-700);
}

/* 통행증 QR */
.kx-dock__qr {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--color-primary-700);
  color: var(--color-on-accent);
  cursor: pointer;
  border: none;
  text-align: left;
  width: 100%;
}
.kx-dock__qr:hover {
  background: var(--color-primary-600);
}
.kx-dock__qr-main {
  flex: 1;
}
.kx-dock__qr-title {
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
  display: block;
}
.kx-dock__qr-sub {
  font-size: var(--fs-micro);
  opacity: 0.85;
  text-transform: uppercase;
}
.kx-dock__qr-glyph {
  background: #fff;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-shrink: 0;
}

/* AI 대기열 예측 카드 */
.kx-dock__ai {
  border: 1px solid var(--color-neutral-200);
  border-left: var(--accent-ai);
  border-radius: var(--radius-lg);
  background: var(--color-white);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.kx-dock__ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.kx-dock__ai-title {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-h3);
  color: var(--color-ai-accent);
}
.kx-dock__chart {
  height: 96px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
  padding: var(--space-2) var(--space-2) 0;
  border-bottom: 1px solid var(--color-neutral-100);
}
.kx-dock__bar {
  flex: 1;
  background: var(--color-ai-accent);
  border-radius: 3px 3px 0 0;
  min-height: 4px;
}
.kx-dock__chart-axis {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-nano);
  color: var(--color-neutral-500);
  padding: 0 2px;
}
.kx-dock__ai-callout {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-ai-accent);
  background: var(--color-ai-surface);
  font-size: var(--fs-caption);
  line-height: var(--lh-body);
  color: var(--color-neutral-700);
}
.kx-dock__ai-callout strong {
  color: var(--color-ai-accent);
}

/* 토스트 */
.kx-dock__toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  background: var(--color-neutral-900);
  color: var(--color-white);
  padding: 10px 18px;
  border-radius: var(--radius-lg);
  font-size: var(--fs-body);
  box-shadow: 0 6px 20px rgba(16, 24, 40, 0.24);
}

/* ── M8 물류 확장 탭(장비 신청·렌탈 주문·선입고) ───────────────────────── */
.kx-logi__tabs {
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.kx-logi__split {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 860px) {
  .kx-logi__split {
    grid-template-columns: 1fr;
  }
}
.kx-logi__row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.kx-logi__estimate {
  margin: 4px 0 2px;
  font-size: var(--fs-body);
  color: var(--color-text-secondary, #475467);
}
.kx-logi__estimate strong {
  color: var(--color-text, #101828);
}
.kx-logi__list {
  min-height: 220px;
}
.kx-logi__items {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kx-logi__item {
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md, 10px);
  padding: 12px 14px;
  background: var(--color-surface, #fff);
}
.kx-logi__item-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.kx-logi__item-name {
  font-weight: var(--fw-semibold);
  color: var(--color-text, #101828);
}
.kx-logi__item-meta {
  margin-top: 4px;
  font-size: var(--fs-caption, 13px);
  color: var(--color-text-secondary, #475467);
}
.kx-logi__reason {
  margin-top: 4px;
  font-size: var(--fs-caption, 13px);
  color: #b42318;
}
.kx-logi__actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}
.kx-logi__act {
  border: 1px solid var(--color-neutral-200);
  background: var(--color-surface, #fff);
  border-radius: var(--radius-sm, 8px);
  padding: 6px 12px;
  font-size: var(--fs-caption, 13px);
  cursor: pointer;
}
.kx-logi__act:disabled {
  opacity: 0.5;
  cursor: default;
}
.kx-logi__act--ok {
  border-color: #12b76a;
  color: #027a48;
}
.kx-logi__act--no {
  border-color: #f04438;
  color: #b42318;
}
.kx-logi__pill {
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.kx-logi__pill--ok {
  background: #ecfdf3;
  color: #027a48;
}
.kx-logi__pill--no {
  background: #fef3f2;
  color: #b42318;
}
.kx-logi__pill--wait {
  background: #fffaeb;
  color: #b54708;
}
.kx-logi__track {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.kx-logi__track-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--color-neutral-200);
}
.kx-logi__track-dot.is-done {
  background: var(--color-primary, #1f29fc);
}
