/* Appily Fiftythree — Dispatch Ledger orders UI */

.af-orders {
  --afo-ink: var(--ts-ink, #15202B);
  --afo-paper: #fff;
  --afo-mist: var(--ts-paper, #F3F5F8);
  --afo-copper: var(--ts-wine, #B85C38);
  --afo-teal: var(--ts-grove, #2A6F7A);
  --afo-line: var(--ts-line, #CDD4DE);
  --afo-muted: var(--ts-muted, #5E6B7A);
  --afo-ease: var(--ease-out, cubic-bezier(.22, 1, .36, 1));
}

@keyframes afo-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes afo-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: .4; }
}
@keyframes afo-load {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(220%); }
}
@keyframes afo-bars {
  0%, 100% { transform: scaleY(.4); }
  50% { transform: scaleY(1); }
}

/* Hero */
.afo-hero {
  position: relative;
  overflow: hidden;
  padding: 48px 0 56px;
  color: #F4F7FA;
  background: linear-gradient(125deg, #15202B 0%, #1B2430 48%, #1A4A52 100%);
}
.afo-hero-mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 70% at 90% 15%, rgba(184, 92, 56, .28), transparent 55%),
    repeating-linear-gradient(-14deg, transparent 0 28px, rgba(255,255,255,.03) 28px 29px);
  pointer-events: none;
}
.afo-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 28px;
  align-items: end;
  animation: afo-rise .65s var(--afo-ease) both;
}
.afo-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #E8C4B4;
}
.afo-pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #7DCFB6;
  animation: afo-pulse 1.8s ease-out infinite;
}
.afo-hero-copy h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 3.8rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.03em;
}
.afo-hero-copy h1 em {
  font-style: italic;
  font-weight: 500;
  color: #F0D2C4;
}
.afo-lede {
  margin: 0;
  max-width: 44ch;
  color: rgba(244, 247, 250, .72);
  font-size: 15px;
  line-height: 1.65;
}
.afo-counter {
  justify-self: end;
  min-width: 140px;
  padding: 22px 20px;
  text-align: center;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .16);
}
.afo-counter strong {
  display: block;
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 1;
  color: #F0D2C4;
}
.afo-counter span {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(244, 247, 250, .55);
}

/* Stage */
.afo-stage {
  padding: 0 0 80px;
  margin-top: -28px;
  position: relative;
  z-index: 2;
}
.afo-loading {
  position: relative;
  overflow: hidden;
  padding: 20px 22px;
  margin-bottom: 16px;
  background: var(--afo-paper);
  border: 1px solid var(--afo-line);
  color: var(--afo-muted);
  box-shadow: var(--shadow-soft);
}
.afo-loading-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(184, 92, 56, .22), transparent);
  animation: afo-load 1.2s ease-in-out infinite;
}

/* Guest gate */
.afo-guest { animation: afo-rise .55s var(--afo-ease) both; }
.afo-gate {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: center;
  padding: 36px 32px;
  background: var(--afo-paper);
  border: 1px solid var(--afo-line);
  box-shadow: var(--shadow);
}
.afo-gate-mark {
  width: 72px; height: 72px;
  display: grid; place-items: center;
  background: var(--afo-ink);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  clip-path: polygon(12% 0, 100% 0, 88% 100%, 0 100%);
}
.afo-gate h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
}
.afo-gate p {
  margin: 0 0 20px;
  color: var(--afo-muted);
  max-width: 48ch;
  line-height: 1.6;
}
.afo-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Board */
.afo-board {
  background: var(--afo-paper);
  border: 1px solid var(--afo-line);
  box-shadow: var(--shadow);
  animation: afo-rise .55s var(--afo-ease) both;
  overflow: hidden;
}
.afo-board-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  flex-wrap: wrap;
  padding: 22px 24px;
  border-bottom: 1px solid var(--afo-line);
  background:
    linear-gradient(90deg, rgba(42, 111, 122, .08), transparent 55%),
    var(--afo-mist);
}
.afo-board-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--afo-copper);
}
.afo-board-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
}
.afo-board-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.afo-board-links a {
  font-size: 12px;
  font-weight: 600;
  color: var(--afo-teal);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.afo-board-links a:hover { color: var(--afo-copper); }

/* Timeline list */
.afo-list {
  position: relative;
  padding: 18px 20px 28px;
  display: grid;
  gap: 14px;
}
.afo-list:not(:empty)::before {
  content: '';
  position: absolute;
  left: 43px;
  top: 34px;
  bottom: 40px;
  width: 2px;
  background: linear-gradient(180deg, var(--afo-copper), var(--afo-teal), var(--afo-line));
  opacity: .55;
  pointer-events: none;
}

.afo-entry {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  opacity: 0;
  animation: afo-rise .45s var(--afo-ease) both;
}
.afo-entry:nth-child(1) { animation-delay: .02s; }
.afo-entry:nth-child(2) { animation-delay: .06s; }
.afo-entry:nth-child(3) { animation-delay: .1s; }
.afo-entry:nth-child(4) { animation-delay: .14s; }
.afo-entry:nth-child(5) { animation-delay: .18s; }

.afo-entry-rail {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 18px;
}
.afo-entry-ix {
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 700;
  color: var(--afo-copper);
}
.afo-entry-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--afo-paper);
  border: 3px solid var(--afo-ink);
  box-shadow: 0 0 0 4px var(--afo-paper);
}
.afo-entry.tone-delivered .afo-entry-dot { border-color: var(--afo-teal); background: var(--afo-teal); }
.afo-entry.tone-shipped .afo-entry-dot { border-color: var(--afo-copper); background: var(--afo-copper); }
.afo-entry.tone-cancelled .afo-entry-dot { border-color: #8a4b4b; background: #8a4b4b; }

.afo-entry-main {
  background: var(--afo-mist);
  border: 1px solid var(--afo-line);
  padding: 18px 18px 16px;
  transition: border-color .25s, transform .3s var(--afo-ease), box-shadow .3s;
}
.afo-entry:hover .afo-entry-main {
  border-color: var(--afo-copper);
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(21, 32, 43, .08);
  background: #fff;
}
.afo-entry-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}
.afo-status {
  display: inline-flex;
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: rgba(21, 32, 43, .08);
  color: var(--afo-ink);
}
.afo-status.tone-delivered { background: rgba(42, 111, 122, .14); color: var(--afo-teal); }
.afo-status.tone-shipped { background: rgba(184, 92, 56, .14); color: var(--afo-copper); }
.afo-status.tone-packed { background: rgba(201, 162, 39, .16); color: #8a7010; }
.afo-status.tone-cancelled { background: rgba(138, 75, 75, .14); color: #8a4b4b; }
.afo-entry-head time {
  font-size: 12px;
  color: var(--afo-muted);
}
.afo-id {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  word-break: break-word;
}
.afo-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.afo-meta div {
  padding: 10px 12px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid var(--afo-line);
  display: grid;
  gap: 3px;
}
.afo-entry:hover .afo-meta div { background: var(--afo-mist); }
.afo-meta em {
  font-style: normal;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--afo-muted);
}
.afo-meta b {
  font-size: 13px;
  font-weight: 700;
}
.afo-items {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--afo-muted);
  line-height: 1.5;
}
.afo-entry-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--afo-line);
}
.afo-pack-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--afo-teal);
}

/* Empty */
.afo-empty {
  text-align: center;
  padding: 56px 24px;
}
.afo-empty-viz {
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;
  height: 36px;
  margin-bottom: 18px;
}
.afo-empty-viz span {
  width: 8px;
  height: 100%;
  background: var(--afo-copper);
  transform-origin: bottom;
  animation: afo-bars 1.2s ease-in-out infinite;
}
.afo-empty-viz span:nth-child(2) {
  background: var(--afo-teal);
  animation-delay: .15s;
}
.afo-empty-viz span:nth-child(3) { animation-delay: .3s; }
.afo-empty h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
}
.afo-empty p {
  margin: 0 auto 22px;
  max-width: 40ch;
  color: var(--afo-muted);
  line-height: 1.6;
}

/* Buttons */
.afo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .25s;
}
.afo-btn:hover { transform: translateY(-2px); }
.afo-btn-primary {
  background: var(--afo-copper);
  color: #fff;
  border-color: var(--afo-copper);
}
.afo-btn-primary:hover {
  background: var(--afo-ink);
  border-color: var(--afo-ink);
}
.afo-btn-ghost {
  background: transparent;
  color: var(--afo-ink);
  border-color: var(--afo-ink);
}
.afo-btn-ghost:hover {
  background: var(--afo-ink);
  color: #fff;
}
.afo-btn-soft {
  background: var(--afo-ink);
  color: #fff;
  border-color: var(--afo-ink);
}
.afo-btn-soft:hover {
  background: var(--afo-copper);
  border-color: var(--afo-copper);
}
.afo-btn-sm {
  padding: 9px 12px;
  font-size: 10px;
}

@media (max-width: 900px) {
  .afo-hero-grid { grid-template-columns: 1fr; }
  .afo-counter { justify-self: start; }
  .afo-meta { grid-template-columns: 1fr; }
  .afo-gate { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .afo-hero { padding: 36px 0 48px; }
  .afo-board-head,
  .afo-list { padding-left: 14px; padding-right: 14px; }
  .afo-list:not(:empty)::before { left: 32px; }
  .afo-entry { grid-template-columns: 36px minmax(0, 1fr); gap: 10px; }
  .afo-gate { padding: 28px 18px; }
}
