/* Appily twentyone — Greensphere Waybill Rail orders */

.page-waybill-rail {
  --gw-ink: #15221c;
  --gw-muted: #5a6d64;
  --gw-line: #c8ddd4;
  --gw-paper: #f2f7f4;
  --gw-ice: #e6f4ed;
  --gw-frost: #b8e4d4;
  --gw-green: #0b7a45;
  --gw-green-dark: #063b22;
  --gw-chill: #1a4d6e;
  --gw-placed: #5a6d64;
  --gw-packed: #1a6b8a;
  --gw-shipped: #0b7a45;
  --gw-delivered: #063b22;
  --gw-cancelled: #9a4a32;
  background: var(--gw-paper);
}

/* ── Dock hero ── */
.gw-dock {
  position: relative;
  padding: 40px 0 48px;
  background: linear-gradient(160deg, #061a12 0%, var(--gw-green-dark) 50%, var(--gw-chill) 100%);
  color: #fff;
  overflow: hidden;
}

.gw-dock-door {
  position: absolute;
  right: 8%;
  top: 50%;
  transform: translateY(-50%);
  width: min(200px, 35vw);
  height: 120px;
  opacity: 0.2;
  pointer-events: none;
}

.gw-door-panel {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #4a5a52, #2a3a32);
  border-radius: 4px 4px 0 0;
}

.gw-door-slats {
  position: absolute;
  inset: 8px 12px;
  background: repeating-linear-gradient(
    180deg,
    transparent,
    transparent 8px,
    rgba(255, 255, 255, 0.08) 8px,
    rgba(255, 255, 255, 0.08) 9px
  );
}

.gw-dock-mist {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 100%, rgba(184, 228, 212, 0.12), transparent 55%);
  pointer-events: none;
}

.gw-dock-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(180px, 0.75fr);
  gap: 32px;
  align-items: center;
}

.gw-kicker {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gw-frost);
}

.gw-dock-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  line-height: 1.12;
  margin: 0 0 12px;
  color: #fff;
}

.gw-dock-copy h1 em {
  font-style: normal;
  color: #a8f0c8;
}

.gw-lede {
  margin: 0;
  max-width: 52ch;
  line-height: 1.65;
  font-size: 0.94rem;
  color: rgba(255, 255, 255, 0.88);
}

.gw-crate-counter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  backdrop-filter: blur(8px);
}

.gw-crate-stack {
  position: relative;
  width: 64px;
  height: 48px;
  margin-bottom: 4px;
}

.gw-crate {
  position: absolute;
  left: 50%;
  width: 48px;
  height: 14px;
  margin-left: -24px;
  background: linear-gradient(180deg, #8a9a92, #6a7a72);
  border-radius: 2px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.gw-crate-a { bottom: 0; }
.gw-crate-b { bottom: 16px; opacity: 0.85; }
.gw-crate-c { bottom: 32px; opacity: 0.7; }

.gw-counter-num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: #fff;
  line-height: 1;
}

.gw-counter-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.gw-dock-lip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 8px;
  background: var(--gw-paper);
  border-radius: 8px 8px 0 0;
}

/* ── Floor ── */
.gw-floor {
  padding: 32px 0 64px;
}

.gw-loading {
  margin-bottom: 20px;
  font-size: 0.88rem;
  color: var(--gw-green);
}

/* ── Guest gate ── */
.gw-guest {
  max-width: 520px;
  margin: 0 auto;
}

.gw-cold-gate {
  position: relative;
  text-align: center;
  padding: 48px 28px 52px;
  background: #fff;
  border: 2px solid var(--gw-line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.gw-gate-frost {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(184, 228, 212, 0.25), transparent 60%);
  pointer-events: none;
}

.gw-gate-lock {
  display: inline-block;
  font-size: 2rem;
  margin-bottom: 12px;
}

.gw-cold-gate h2 {
  margin: 0 0 10px;
  font-size: 1.35rem;
}

.gw-cold-gate p {
  margin: 0 0 22px;
  color: var(--gw-muted);
  line-height: 1.6;
}

.gw-guest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

/* ── Rail board ── */
.gw-rail-board {
  position: relative;
  padding: 24px 20px 32px;
  background: #fff;
  border: 1px solid var(--gw-line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.gw-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.gw-board-tag {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gw-green);
}

.gw-board-meta {
  font-size: 0.78rem;
  color: var(--gw-muted);
}

.gw-rail-line {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 72px;
  height: 3px;
  background: linear-gradient(90deg, var(--gw-green-dark), var(--gw-green), var(--gw-green-dark));
  border-radius: 2px;
  box-shadow: 0 2px 6px rgba(6, 59, 34, 0.2);
}

/* ── Waybill cards (JS-rendered) ── */
.gw-waybills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding-top: 16px;
}

.greensphere-waybill {
  position: relative;
  padding: 18px 18px 20px;
  background: var(--gw-paper);
  border: 1px solid var(--gw-line);
  border-radius: 0 0 10px 10px;
  transform: rotate(var(--gw-swing, 0deg));
  transform-origin: top center;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(6, 59, 34, 0.06);
}

.greensphere-waybill:hover {
  transform: rotate(0deg) translateY(-4px);
  box-shadow: 0 8px 24px rgba(11, 122, 69, 0.12);
}

.gw-waybill-clip {
  position: absolute;
  left: 50%;
  top: -14px;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  background: linear-gradient(180deg, #9aa8a0, #6a7a72);
  border-radius: 4px 4px 0 0;
  box-shadow: 0 -2px 0 var(--gw-green);
}

.gw-waybill-clip::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -6px;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border: 2px solid var(--gw-green);
  border-radius: 50%;
  background: #fff;
}

.gw-waybill-perf {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 6px;
  background:
    radial-gradient(circle at 6px 0, transparent 5px, var(--gw-line) 5px) 0 0 / 12px 6px repeat-x;
}

.gw-waybill-temp {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 8px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: var(--gw-ice);
  color: var(--gw-green);
  border-radius: 4px;
}

.gw-waybill-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-top: 4px;
}

.gw-waybill-status {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--gw-ice);
  color: var(--gw-green);
}

.greensphere-waybill.tone-placed .gw-waybill-status {
  background: #eef0ef;
  color: var(--gw-placed);
}

.greensphere-waybill.tone-packed .gw-waybill-status {
  background: #e6f2f8;
  color: var(--gw-packed);
}

.greensphere-waybill.tone-shipped .gw-waybill-status {
  background: var(--gw-ice);
  color: var(--gw-shipped);
}

.greensphere-waybill.tone-delivered .gw-waybill-status {
  background: var(--gw-green-dark);
  color: #fff;
}

.greensphere-waybill.tone-cancelled .gw-waybill-status {
  background: #fdf0ec;
  color: var(--gw-cancelled);
}

.gw-waybill-time {
  font-size: 0.75rem;
  color: var(--gw-muted);
}

.gw-waybill-id {
  margin: 0 0 12px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gw-ink);
  letter-spacing: 0.02em;
}

.gw-waybill-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--gw-line);
}

.gw-waybill-meta div {
  text-align: center;
}

.gw-waybill-meta dt {
  margin: 0 0 2px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gw-muted);
}

.gw-waybill-meta dd {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gw-ink);
}

.gw-waybill-items {
  margin: 0 0 14px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--gw-muted);
}

.greensphere-waybill-track {
  display: inline-flex;
  width: 100%;
  justify-content: center;
}

/* Status left border accent */
.greensphere-waybill.tone-placed { border-left: 4px solid var(--gw-placed); }
.greensphere-waybill.tone-packed { border-left: 4px solid var(--gw-packed); }
.greensphere-waybill.tone-shipped { border-left: 4px solid var(--gw-shipped); }
.greensphere-waybill.tone-delivered { border-left: 4px solid var(--gw-delivered); }
.greensphere-waybill.tone-cancelled { border-left: 4px solid var(--gw-cancelled); }

/* ── Empty state ── */
.gw-empty {
  text-align: center;
  padding: 40px 24px 48px;
}

.gw-empty-rail {
  position: relative;
  width: 240px;
  height: 80px;
  margin: 0 auto 24px;
}

.gw-empty-wire {
  position: absolute;
  left: 0;
  right: 0;
  top: 20px;
  height: 3px;
  background: var(--gw-green);
  border-radius: 2px;
}

.gw-empty-hook {
  position: absolute;
  top: 14px;
  width: 12px;
  height: 16px;
  border: 2px solid var(--gw-green);
  border-top: 0;
  border-radius: 0 0 6px 6px;
}

.gw-empty-hook:nth-of-type(2) { left: 20%; }
.gw-empty-hook:nth-of-type(3) { left: 50%; margin-left: -6px; }
.gw-empty-hook:nth-of-type(4) { right: 20%; }

.gw-empty-label {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gw-muted);
}

.gw-empty h2 {
  margin: 0 0 10px;
  font-size: 1.3rem;
}

.gw-empty p {
  margin: 0 0 20px;
  color: var(--gw-muted);
  max-width: 40ch;
  margin-left: auto;
  margin-right: auto;
}

/* ── Buttons ── */
.gw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.gw-btn-primary {
  background: var(--gw-green);
  color: #fff;
}

.gw-btn-primary:hover {
  background: var(--gw-green-dark);
}

.gw-btn-soft {
  background: var(--gw-ice);
  color: var(--gw-green);
  border-color: rgba(11, 122, 69, 0.2);
}

.gw-btn-soft:hover {
  background: #d4eddf;
}

.gw-btn-sm {
  padding: 8px 14px;
  font-size: 0.8rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .gw-dock-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .gw-crate-counter {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .gw-waybills {
    grid-template-columns: 1fr;
  }

  .greensphere-waybill {
    transform: none;
  }

  .gw-rail-line {
    display: none;
  }
}

@media (max-width: 640px) {
  .gw-dock-grid { gap: 16px; }
  .gw-waybills { gap: 12px; }
  .greensphere-waybill { padding: 16px; }
  .gw-crate-counter { gap: 8px; }
  .gw-btn { width: 100%; justify-content: center; }
}
