.deliveries-main {
  width: min(100%, 1180px);
  min-height: calc(100dvh - var(--image-header-height));
  margin: 0 auto;
  padding: 46px 28px 80px;
}

.deliveries-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
}

.deliveries-intro > div {
  max-width: 720px;
}

.deliveries-eyebrow,
.deliveries-toolbar > div > span {
  margin: 0 0 8px;
  color: var(--image-accent);
  font-size: 9px;
  font-weight: 800;
}

.deliveries-intro h1 {
  margin: 0;
  font-size: clamp(34px, 4.4vw, 52px);
  line-height: 1.06;
  letter-spacing: 0;
}

.deliveries-intro > div > p:last-child {
  max-width: 64ch;
  margin: 14px 0 0;
  color: var(--image-muted);
  font-size: 13px;
  line-height: 1.7;
}

.deliveries-create {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--image-accent);
  border-radius: 6px;
  background: var(--image-accent);
  color: var(--image-accent-ink);
  padding: 0 15px;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease, filter 160ms ease;
}

.deliveries-create,
.deliveries-create span {
  color: var(--image-accent-ink) !important;
}

.deliveries-create:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.deliveries-create svg {
  width: 15px;
  height: 15px;
}

.deliveries-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 36px;
  border: 1px solid var(--image-line);
  border-radius: 7px;
  background: var(--image-surface);
}

.deliveries-metrics article {
  display: grid;
  min-width: 0;
  min-height: 92px;
  border-right: 1px solid var(--image-line);
  padding: 17px 19px;
  gap: 8px;
}

.deliveries-metrics article:last-child {
  border-right: 0;
}

.deliveries-metrics span {
  color: var(--image-muted);
  font-size: 10px;
  font-weight: 700;
}

.deliveries-metrics strong {
  font-size: 25px;
  line-height: 1;
}

.deliveries-board {
  margin-top: 18px;
  border: 1px solid var(--image-line);
  border-radius: 7px;
  background: var(--image-surface);
}

.deliveries-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  border-bottom: 1px solid var(--image-line);
  padding: 14px 18px;
  gap: 20px;
}

.deliveries-toolbar h2 {
  margin: 0;
  font-size: 17px;
}

.deliveries-filter {
  display: inline-flex;
  border: 1px solid var(--image-line);
  border-radius: 6px;
  background: #0c0e12;
  padding: 3px;
}

.deliveries-filter button {
  min-height: 40px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--image-muted);
  padding: 0 10px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
}

.deliveries-filter button.is-active {
  background: var(--image-surface-3);
  color: var(--image-text);
}

.deliveries-list {
  min-height: 280px;
}

.delivery-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.3fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr) auto;
  align-items: center;
  border-bottom: 1px solid var(--image-line);
  padding: 16px 18px;
  gap: 18px;
  animation: delivery-row-in 260ms ease both;
}

.delivery-row:last-child {
  border-bottom: 0;
}

.delivery-row-title,
.delivery-row-cell {
  min-width: 0;
}

.delivery-row-title strong,
.delivery-row-cell strong {
  display: block;
  overflow: hidden;
  color: var(--image-text);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-row-title small,
.delivery-row-cell small {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--image-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-state {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  border: 1px solid var(--image-line-strong);
  border-radius: 999px;
  color: var(--image-muted);
  padding: 0 8px;
  gap: 6px;
  font-size: 9px;
  font-weight: 800;
}

.delivery-state::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7b8490;
  content: "";
}

.delivery-state.is-ready {
  border-color: #2f655c;
  color: #9ce2d6;
}

.delivery-state.is-ready::before {
  background: var(--image-accent);
}

.delivery-state.is-active::before {
  background: #e4bd68;
}

.delivery-state.is-attention {
  border-color: #6e4147;
  color: #efb3bc;
}

.delivery-state.is-attention::before {
  background: #e98391;
}

.delivery-row-actions {
  display: flex;
  justify-content: end;
  gap: 7px;
}

.delivery-row-actions a,
.delivery-row-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--image-line-strong);
  border-radius: 6px;
  background: var(--image-surface-2);
  color: var(--image-text);
  padding: 0 10px;
  cursor: pointer;
  gap: 6px;
  font-size: 10px;
  font-weight: 750;
  text-decoration: none;
}

.delivery-row-actions svg {
  width: 13px;
  height: 13px;
}

.delivery-detail {
  grid-column: 1 / -1;
  border-top: 1px solid var(--image-line);
  padding-top: 15px;
}

.deliveries-empty,
.deliveries-loading {
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 36px;
  color: var(--image-muted);
  text-align: center;
}

.deliveries-empty svg {
  width: 28px;
  height: 28px;
  color: var(--image-accent);
}

.deliveries-empty strong {
  margin-top: 12px;
  color: var(--image-text);
  font-size: 15px;
}

.deliveries-empty p {
  max-width: 48ch;
  margin: 7px 0 0;
  font-size: 11px;
  line-height: 1.6;
}

.deliveries-empty a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-top: 14px;
  color: var(--image-accent);
  font-size: 11px;
  font-weight: 750;
}

.deliveries-loading {
  grid-template-columns: repeat(3, 7px);
  align-content: center;
  gap: 6px;
}

.deliveries-loading span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--image-accent);
  animation: delivery-pulse 900ms ease-in-out infinite alternate;
}

.deliveries-loading span:nth-child(2) { animation-delay: 150ms; }
.deliveries-loading span:nth-child(3) { animation-delay: 300ms; }
.deliveries-loading p { grid-column: 1 / -1; margin: 8px 0 0; font-size: 10px; }

@keyframes delivery-row-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes delivery-pulse {
  from { opacity: 0.3; transform: translateY(0); }
  to { opacity: 1; transform: translateY(-4px); }
}

@media (max-width: 780px) {
  .deliveries-main { padding: 32px 16px 62px; }
  .deliveries-intro { align-items: start; flex-direction: column; }
  .deliveries-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deliveries-metrics article:nth-child(2) { border-right: 0; }
  .deliveries-metrics article:nth-child(-n+2) { border-bottom: 1px solid var(--image-line); }
  .delivery-row { grid-template-columns: minmax(0, 1fr) auto; gap: 13px; }
  .delivery-row-cell { grid-column: 1; }
  .delivery-row-actions { grid-column: 2; grid-row: 1 / span 3; flex-direction: column; }
}

@media (max-width: 560px) {
  .deliveries-intro h1 { font-size: 34px; }
  .deliveries-create { width: 100%; }
  .deliveries-toolbar { align-items: stretch; flex-direction: column; }
  .deliveries-filter { width: 100%; overflow-x: auto; }
  .deliveries-filter button { flex: 1 0 auto; }
  .delivery-row { grid-template-columns: minmax(0, 1fr); }
  .delivery-row-actions { grid-column: 1; grid-row: auto; justify-content: start; flex-direction: row; }
}

@media (prefers-reduced-motion: reduce) {
  .delivery-row,
  .deliveries-loading span { animation: none !important; }
  .deliveries-create:hover { transform: none; }
}
