/* Receiving list workspace.
   Scoped classes keep receiving planning independent from shipment screens. */

.receiving-list-page{
  gap:14px;
}

.receiving-list-page .ops-list-toolbar{
  min-width:0;
}

.receiving-list-page #receiving-status-filter{
  min-width:220px;
}

.receiving-view-switch,
.receiving-cal-scale-switch{
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-width:0;
  padding:4px;
  border:1px solid rgba(148,163,184,.22);
  border-radius:8px;
  background:rgba(15,23,42,.28);
}

.receiving-view-switch__btn,
.receiving-cal-scale-switch__btn{
  justify-content:center;
}

.receiving-view-switch__btn.is-active,
.receiving-cal-scale-switch__btn.is-active{
  background:rgba(47,107,255,.24);
  border-color:rgba(96,165,250,.48);
  color:#fff;
}

.receiving-view-host{
  padding:12px;
}

.receiving-board{
  display:grid;
  grid-template-columns:repeat(4, minmax(240px, 1fr));
  gap:12px;
  align-items:start;
}

.receiving-lane{
  min-width:0;
  min-height:180px;
  border:1px solid rgba(148,163,184,.20);
  border-radius:8px;
  background:rgba(2,6,23,.20);
  overflow:hidden;
}

.receiving-lane__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:9px 10px;
  border-bottom:1px solid rgba(148,163,184,.16);
  background:rgba(15,23,42,.24);
}

.receiving-lane__title{
  min-width:0;
  color:var(--text);
  font-size:13px;
  font-weight:850;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.receiving-lane__count{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:24px;
  height:24px;
  padding:0 7px;
  border:1px solid rgba(148,163,184,.26);
  border-radius:999px;
  color:rgba(226,232,240,.92);
  font-size:12px;
  font-weight:850;
}

.receiving-lane__body{
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:8px;
}

.receiving-lane__empty,
.receiving-empty-state,
.receiving-loading-state,
.receiving-error-state{
  min-width:0;
  padding:12px;
  border:1px dashed rgba(148,163,184,.26);
  border-radius:8px;
  color:var(--muted);
  line-height:1.35;
  overflow-wrap:anywhere;
}

.receiving-error-state{
  border-color:rgba(239,68,68,.48);
  background:rgba(127,29,29,.14);
  color:#fecaca;
}

.receiving-card{
  display:grid;
  gap:8px;
  min-width:0;
  padding:10px;
  border:1px solid rgba(148,163,184,.22);
  border-radius:8px;
  background:rgba(15,23,42,.48);
  cursor:pointer;
}

.receiving-card:hover{
  border-color:rgba(96,165,250,.50);
  background:rgba(15,23,42,.72);
}

.receiving-card--compact{
  padding:8px;
  gap:6px;
}

.receiving-card__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
  min-width:0;
}

.receiving-card__code{
  min-width:0;
  color:var(--text);
  font-weight:900;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.receiving-card__badges,
.receiving-card__metrics,
.receiving-card__actions{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:6px;
  min-width:0;
}

.receiving-card__badges{
  justify-content:flex-end;
}

.receiving-card__meta-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:4px 8px;
  min-width:0;
  color:rgba(203,213,225,.92);
  font-size:12px;
}

.receiving-card--compact .receiving-card__meta-grid{
  grid-template-columns:1fr;
}

.receiving-card__meta-grid div{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.receiving-card__meta-grid span{
  color:var(--muted);
  margin-right:4px;
}

.receiving-card__comment{
  min-width:0;
  padding-top:7px;
  border-top:1px dashed rgba(148,163,184,.22);
  color:rgba(203,213,225,.86);
  font-size:12px;
  overflow-wrap:anywhere;
}

.receiving-metric-badge{
  display:inline-flex;
  align-items:center;
  min-height:22px;
  padding:2px 8px;
  border:1px solid rgba(148,163,184,.30);
  border-radius:999px;
  background:rgba(30,41,59,.45);
  color:rgba(226,232,240,.95);
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
}

.receiving-metric-badge.is-danger{
  border-color:rgba(239,68,68,.48);
  background:rgba(239,68,68,.16);
  color:#fecaca;
}

.receiving-metric-badge.is-blue{
  border-color:rgba(96,165,250,.45);
  background:rgba(59,130,246,.16);
  color:#bfdbfe;
}

.receiving-card__metrics--cell{
  margin-top:5px;
}

.receiving-cal-controls{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  min-width:0;
  padding:10px 12px;
  border-bottom:1px solid rgba(148,163,184,.14);
}

.receiving-cal-title{
  min-width:0;
  color:var(--text);
  font-weight:850;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.receiving-calendar-grid{
  min-width:0;
  border:1px solid rgba(148,163,184,.18);
  border-radius:8px;
  overflow:hidden;
}

.receiving-cal-grid-head,
.receiving-cal-grid-body{
  display:grid;
  grid-template-columns:repeat(7, minmax(0, 1fr));
}

.receiving-cal-head-cell{
  padding:8px 10px;
  border-right:1px solid rgba(148,163,184,.12);
  border-bottom:1px solid rgba(148,163,184,.18);
  color:var(--muted);
  font-size:11px;
  font-weight:850;
  letter-spacing:.04em;
  text-transform:uppercase;
}

.receiving-cal-head-cell:last-child{
  border-right:0;
}

.receiving-cal-day{
  min-width:0;
  min-height:122px;
  padding:8px;
  border-right:1px solid rgba(148,163,184,.11);
  border-bottom:1px solid rgba(148,163,184,.11);
  background:rgba(2,6,23,.16);
}

.receiving-cal-day.is-empty{
  background:rgba(2,6,23,.08);
}

.receiving-cal-day:nth-child(7n){
  border-right:0;
}

.receiving-cal-day__num{
  margin-bottom:5px;
  color:var(--muted);
  font-size:12px;
  font-weight:800;
}

.receiving-cal-day__items,
.receiving-cal-day-list{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.receiving-cal-day__add-wrap{
  display:flex;
  justify-content:flex-end;
  margin-top:8px;
}

.receiving-cal-day__add-btn{
  white-space:nowrap;
}

.receiving-cal-item{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
  padding:6px 7px;
  border:1px solid rgba(148,163,184,.22);
  border-radius:7px;
  background:rgba(15,23,42,.48);
  cursor:pointer;
}

.receiving-cal-item:hover{
  border-color:rgba(96,165,250,.50);
}

.receiving-cal-item__time{
  flex:0 0 auto;
  min-width:34px;
  color:var(--muted);
  font-size:11px;
}

.receiving-cal-item__code{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:12px;
  font-weight:850;
}

.receiving-calendar-unscheduled{
  margin-top:12px;
}

.receiving-unscheduled-box{
  border:1px solid rgba(148,163,184,.18);
  border-radius:8px;
  background:rgba(2,6,23,.18);
  overflow:hidden;
}

.receiving-unscheduled-box__title{
  padding:9px 10px;
  border-bottom:1px solid rgba(148,163,184,.16);
  color:var(--text);
  font-weight:850;
}

.receiving-unscheduled-box__list{
  display:grid;
}

.receiving-unscheduled-item{
  display:grid;
  grid-template-columns:140px minmax(0, 1fr) auto;
  gap:10px;
  align-items:center;
  min-width:0;
  padding:8px 10px;
  border-top:1px solid rgba(148,163,184,.10);
  cursor:pointer;
}

.receiving-unscheduled-item:first-child{
  border-top:0;
}

.receiving-unscheduled-item:hover{
  background:rgba(59,130,246,.08);
}

.receiving-unscheduled-item__code{
  font-weight:900;
}

.receiving-unscheduled-item__meta{
  min-width:0;
  color:var(--muted);
  font-size:12px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.receiving-cal-week-grid{
  display:grid;
  grid-template-columns:repeat(7, minmax(220px, 1fr));
  gap:10px;
  overflow-x:auto;
  padding-bottom:4px;
}

.receiving-cal-week-col{
  min-width:0;
  min-height:260px;
  border:1px solid rgba(148,163,184,.18);
  border-radius:8px;
  background:rgba(2,6,23,.18);
  overflow:hidden;
}

.receiving-cal-week-col__head{
  padding:9px 10px;
  border-bottom:1px solid rgba(148,163,184,.16);
  font-weight:850;
  text-transform:capitalize;
}

.receiving-cal-week-col__body{
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:8px;
}

.receiving-cal-week-col > .receiving-cal-day__add-wrap{
  margin-top:0;
  padding:0 8px 8px;
}

.receiving-cal-week-col__empty,
.receiving-cal-day-list__empty{
  padding:12px;
  border:1px dashed rgba(148,163,184,.24);
  border-radius:8px;
  color:var(--muted);
}

html[data-theme="light"] .receiving-view-switch,
html[data-theme="light"] .receiving-cal-scale-switch,
html[data-theme="light"] .receiving-lane,
html[data-theme="light"] .receiving-calendar-grid,
html[data-theme="light"] .receiving-cal-week-col,
html[data-theme="light"] .receiving-unscheduled-box{
  background:#ffffff;
  border-color:#cbd5e1;
}

html[data-theme="light"] .receiving-card,
html[data-theme="light"] .receiving-cal-item,
html[data-theme="light"] .receiving-cal-day,
html[data-theme="light"] .receiving-lane__head,
html[data-theme="light"] .receiving-cal-controls{
  background:#f8fafc;
  border-color:#d0d5dd;
  color:#101828;
}

html[data-theme="light"] .receiving-card:hover,
html[data-theme="light"] .receiving-cal-item:hover,
html[data-theme="light"] .receiving-unscheduled-item:hover{
  background:#eff6ff;
  border-color:#93c5fd;
}

html[data-theme="light"] .receiving-card__code,
html[data-theme="light"] .receiving-lane__title,
html[data-theme="light"] .receiving-cal-title,
html[data-theme="light"] .receiving-unscheduled-box__title{
  color:#101828;
}

html[data-theme="light"] .receiving-card__meta-grid,
html[data-theme="light"] .receiving-card__comment{
  color:#344054;
}

html[data-theme="light"] .receiving-metric-badge{
  background:#f2f6fb;
  border-color:#b9c4d4;
  color:#1d2735;
}

html[data-theme="light"] .receiving-error-state{
  background:#fef3f2;
  border-color:#fda29b;
  color:#b42318;
}

@media (max-width: 1400px){
  .receiving-board{
    grid-template-columns:repeat(3, minmax(220px, 1fr));
  }

  .receiving-cal-week-grid{
    grid-template-columns:repeat(4, minmax(220px, 1fr));
  }
}

@media (max-width: 1100px){
  .receiving-board{
    grid-template-columns:repeat(2, minmax(220px, 1fr));
  }

  .receiving-card__meta-grid{
    grid-template-columns:1fr;
  }

  .receiving-cal-week-grid{
    grid-template-columns:repeat(2, minmax(220px, 1fr));
  }

  .receiving-unscheduled-item{
    grid-template-columns:120px minmax(0, 1fr);
  }

  .receiving-unscheduled-item__status{
    grid-column:1 / -1;
  }
}

@media (max-width: 980px){
  .receiving-list-page .page-header,
  .receiving-list-page .toolbar{
    flex-direction:column;
    align-items:stretch;
  }

  .receiving-list-page .page-header__actions,
  .receiving-list-page .toolbar__left,
  .receiving-list-page .toolbar__right{
    width:100%;
  }

  .receiving-list-page .page-header__actions .btn,
  .receiving-list-page #receiving-status-filter,
  .receiving-list-page #receivings-view-switch{
    width:100%;
  }

  .receiving-list-page #receivings-view-switch{
    justify-content:stretch;
  }

  .receiving-list-page #receivings-view-switch .receiving-view-switch__btn{
    flex:1 1 0;
  }
}

@media (max-width: 760px){
  .receiving-view-switch,
  .receiving-cal-scale-switch{
    width:100%;
    justify-content:stretch;
  }

  .receiving-view-switch__btn,
  .receiving-cal-scale-switch__btn{
    flex:1 1 0;
  }

  .receiving-board{
    grid-template-columns:1fr;
  }

  .receiving-cal-title{
    width:100%;
  }

  .receiving-cal-grid-head,
  .receiving-cal-grid-body{
    grid-template-columns:1fr;
  }

  .receiving-cal-head-cell,
  .receiving-cal-day.is-empty{
    display:none;
  }

  .receiving-cal-day{
    min-height:auto;
  }

  .receiving-cal-week-grid{
    grid-template-columns:1fr;
  }

  .receiving-unscheduled-item{
    grid-template-columns:1fr;
  }

  .receiving-unscheduled-item__status{
    grid-column:auto;
  }
}

@media (max-width: 520px){
  .receiving-view-switch{
    display:grid;
    grid-template-columns:1fr;
  }

  .receiving-cal-controls{
    display:grid;
    grid-template-columns:1fr 1fr;
  }

  .receiving-cal-scale-switch,
  .receiving-cal-title{
    grid-column:1 / -1;
  }
}
