/* Appily Fortynine — Seed Logbook orders (unique layout + kinetic UI) */
@keyframes a49-log-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes a49-log-spin {
  to { transform: rotate(360deg); }
}
@keyframes a49-log-pulse {
  0% { box-shadow: 0 0 0 0 rgba(200,245,66,.45); }
  70% { box-shadow: 0 0 0 12px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@keyframes a49-log-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.page-orders {
  --log-deep: #0B2B33;
  --log-accent: #C8F542;
  --log-coral: #FF5C39;
  --log-mist: #F4F8F7;
  --log-line: #D5E1E3;
  --log-muted: #5E757A;
}

.a49-logbook { overflow: clip; }

/* Mast */
.a49-logbook-mast {
  position: relative; isolation: isolate;
  background: linear-gradient(145deg, #071F24 0%, #0B2B33 50%, #134E4A 100%);
  color: #F4F8F7; padding: clamp(2.2rem, 5vw, 3.6rem) 0 3.2rem; overflow: hidden;
}
.a49-logbook-mast::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 52px;
  background: var(--log-mist); clip-path: polygon(0 50%, 100% 0, 100% 100%, 0 100%); z-index: 1;
}
.a49-logbook-orb {
  position: absolute; width: 260px; height: 260px; border-radius: 45% 55% 50% 50%;
  right: 8%; top: -40px; z-index: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(200,245,66,.3), transparent 70%);
  animation: a49-log-float 7s ease-in-out infinite;
}
.a49-logbook-mast-grid {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1.3fr .7fr; gap: 22px; align-items: center;
}
.a49-logbook-kicker {
  margin: 0 0 12px; font-size: .76rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--log-accent); font-weight: 800;
}
.a49-logbook-intro h1 {
  margin: 0 0 12px; font-family: var(--font-display, 'Bricolage Grotesque', sans-serif);
  font-size: clamp(2.1rem, 4.4vw, 3.3rem); line-height: 1.05; letter-spacing: -0.03em; max-width: 12ch;
}
.a49-logbook-intro h1 em { font-style: normal; color: var(--log-accent); }
.a49-logbook-lede { margin: 0; color: rgba(244,248,247,.76); max-width: 44ch; }
.a49-logbook-count {
  justify-self: end; width: min(200px, 100%);
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  border-radius: 24px; padding: 22px; text-align: center;
  backdrop-filter: blur(8px); animation: a49-log-rise .55s ease both;
}
.a49-logbook-count strong {
  display: block; font-family: var(--font-display, 'Bricolage Grotesque', sans-serif);
  font-size: 2.6rem; line-height: 1; color: var(--log-accent);
}
.a49-logbook-count span {
  display: block; margin-top: 6px; font-size: .75rem; letter-spacing: .1em;
  text-transform: uppercase; color: rgba(244,248,247,.65); font-weight: 800;
}

/* Stage */
.a49-logbook-stage { padding: 8px 0 64px; }
.a49-logbook-loading {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: #fff; border: 1px solid var(--log-line); border-radius: 22px;
  padding: 28px; color: var(--log-muted); font-weight: 700;
  box-shadow: 0 14px 30px rgba(11,43,51,.06);
}
.a49-logbook-loading-ring {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid rgba(11,43,51,.12); border-top-color: var(--log-coral);
  animation: a49-log-spin .8s linear infinite;
}

/* Guest gate */
.a49-logbook-guest { animation: a49-log-rise .5s ease both; }
.a49-logbook-gate {
  background: #fff; border: 1px solid var(--log-line); border-radius: 28px;
  padding: clamp(28px, 5vw, 48px); text-align: center;
  box-shadow: 0 18px 40px rgba(11,43,51,.08); max-width: 560px; margin: 0 auto;
}
.a49-logbook-gate-seal {
  display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 20px;
  background: var(--log-deep); color: var(--log-accent);
  font-family: var(--font-display, 'Bricolage Grotesque', sans-serif); font-weight: 800; font-size: 1.2rem;
  margin-bottom: 12px; animation: a49-log-pulse 2.6s ease-out infinite;
}
.a49-logbook-gate-tag {
  display: inline-block; margin-bottom: 10px; padding: 5px 10px; border-radius: 999px;
  background: rgba(255,92,57,.12); color: var(--log-coral);
  font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
}
.a49-logbook-gate h2 {
  margin: 0 0 8px; font-family: var(--font-display, 'Bricolage Grotesque', sans-serif);
  font-size: 1.55rem; color: var(--log-deep);
}
.a49-logbook-gate p { margin: 0 auto 18px; max-width: 40ch; color: var(--log-muted); }
.a49-logbook-gate-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.a49-logbook-btn-ghost {
  background: transparent; color: var(--log-deep);
  border: 1px solid var(--log-line); border-radius: 12px;
}
.a49-logbook-btn-ghost:hover { border-color: var(--log-deep); }

/* Workspace */
.a49-logbook-workspace {
  display: grid; grid-template-columns: 230px 1fr; gap: 22px; align-items: start;
}
.a49-logbook-rail {
  position: sticky; top: 96px;
  background: #fff; border: 1px solid var(--log-line); border-radius: 24px; padding: 18px;
  box-shadow: 0 14px 30px rgba(11,43,51,.06);
}
.a49-logbook-rail-label {
  margin: 0 0 12px; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--log-muted); font-weight: 800;
}
.a49-logbook-rail-steps {
  list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px;
}
.a49-logbook-rail-steps li {
  display: grid; grid-template-columns: 14px 1fr; column-gap: 10px; align-items: start;
}
.a49-logbook-rail-steps li span {
  width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: var(--log-line);
}
.a49-logbook-rail-steps li.tone-placed span { background: #7B8FA1; }
.a49-logbook-rail-steps li.tone-packed span { background: #E0A800; }
.a49-logbook-rail-steps li.tone-shipped span { background: var(--log-coral); }
.a49-logbook-rail-steps li.tone-delivered span { background: #9BC920; }
.a49-logbook-rail-steps strong {
  display: block; font-family: var(--font-display, 'Bricolage Grotesque', sans-serif);
  font-size: .95rem; color: var(--log-deep);
}
.a49-logbook-rail-steps small { color: var(--log-muted); font-size: .78rem; }
.a49-logbook-rail-note {
  padding-top: 14px; border-top: 1px dashed var(--log-line);
}
.a49-logbook-rail-note strong { display: block; margin-bottom: 4px; color: var(--log-deep); }
.a49-logbook-rail-note p { margin: 0; color: var(--log-muted); font-size: .88rem; }
.a49-logbook-rail-note a { color: var(--log-coral); font-weight: 700; }

/* Order cards */
.a49-logbook-list { display: grid; gap: 12px; }
.a49-log-card.order-row {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center;
  background: #fff; border: 1px solid var(--log-line); border-radius: 22px;
  padding: 14px; box-shadow: 0 12px 28px rgba(11,43,51,.06);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  animation: a49-log-rise .5s ease both;
  animation-delay: calc(var(--ord-i, 0) * 0.05s);
  overflow: hidden; position: relative;
}
.a49-log-card.order-row:nth-child(even) { transform: translateX(8px); }
.a49-log-card.order-row:hover {
  transform: translateY(-4px); border-color: rgba(200,245,66,.75);
  box-shadow: 0 18px 36px rgba(11,43,51,.12);
}
.a49-log-card-rail {
  display: grid; justify-items: center; gap: 10px; align-content: center;
  min-height: 96px; border-radius: 16px; padding: 10px 0;
  background: #F7FBFA;
}
.a49-log-card.tone-placed .a49-log-card-rail { background: rgba(123,143,161,.14); }
.a49-log-card.tone-packed .a49-log-card-rail { background: rgba(224,168,0,.14); }
.a49-log-card.tone-shipped .a49-log-card-rail { background: rgba(255,92,57,.12); }
.a49-log-card.tone-delivered .a49-log-card-rail { background: rgba(200,245,66,.22); }
.a49-log-card-num {
  font-family: var(--font-display, 'Bricolage Grotesque', sans-serif);
  font-weight: 800; color: var(--log-deep); font-size: .9rem;
}
.a49-log-card-pulse {
  width: 10px; height: 10px; border-radius: 50%; background: var(--log-accent);
  animation: a49-log-pulse 2.2s ease-out infinite;
}
.a49-log-card.tone-shipped .a49-log-card-pulse { background: var(--log-coral); }
.a49-log-card.tone-packed .a49-log-card-pulse { background: #E0A800; }
.a49-log-card.tone-placed .a49-log-card-pulse { background: #7B8FA1; }

.a49-log-card-top {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px;
}
.a49-log-card-status {
  padding: 4px 10px; border-radius: 999px; background: var(--log-deep); color: var(--log-accent);
  font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.a49-log-card-top time { color: var(--log-muted); font-size: .82rem; font-weight: 600; }
.a49-log-card-body h3 {
  margin: 0 0 4px; font-family: var(--font-display, 'Bricolage Grotesque', sans-serif);
  font-size: 1.15rem; color: var(--log-deep); letter-spacing: -0.02em;
}
.a49-log-card-meta { margin: 0 0 4px; color: var(--log-coral); font-weight: 800; font-size: .95rem; }
.a49-log-card-items { margin: 0; color: var(--log-muted); font-size: .88rem; }
.a49-logbook-view {
  background: var(--log-deep); color: var(--log-accent); border-radius: 12px;
  padding: 10px 14px; font-weight: 800; white-space: nowrap;
}
.a49-logbook-view:hover { background: #123940; transform: translateY(-2px); }

/* Empty */
.a49-logbook-empty {
  text-align: center; background: #fff; border: 1px dashed var(--log-line);
  border-radius: 28px; padding: clamp(32px, 5vw, 52px);
}
.a49-logbook-empty-mark {
  width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 22px;
  background: linear-gradient(145deg, var(--log-accent), #9BC920);
  box-shadow: 0 12px 0 var(--log-deep); transform: rotate(-6deg);
  animation: a49-log-float 4s ease-in-out infinite;
}
.a49-logbook-empty h2 {
  margin: 0 0 8px; font-family: var(--font-display, 'Bricolage Grotesque', sans-serif);
  font-size: 1.5rem; color: var(--log-deep);
}
.a49-logbook-empty p { margin: 0 auto 18px; max-width: 42ch; color: var(--log-muted); }

/* Bento */
.a49-logbook-bento {
  margin-top: 22px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.a49-logbook-bento a {
  background: #fff; border: 1px solid var(--log-line); border-radius: 20px; padding: 16px;
  display: grid; gap: 4px; transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.a49-logbook-bento a span {
  font-family: var(--font-display, 'Bricolage Grotesque', sans-serif);
  font-size: .72rem; font-weight: 800; color: var(--log-muted); letter-spacing: .08em;
}
.a49-logbook-bento a strong {
  font-family: var(--font-display, 'Bricolage Grotesque', sans-serif);
  font-size: 1.05rem; color: var(--log-deep);
}
.a49-logbook-bento a em { font-style: normal; color: var(--log-muted); font-size: .82rem; }
.a49-logbook-bento a:hover {
  transform: translateY(-4px); border-color: rgba(200,245,66,.8);
  box-shadow: 0 14px 28px rgba(11,43,51,.1);
}

@media (max-width: 980px) {
  .a49-logbook-mast-grid { grid-template-columns: 1fr; }
  .a49-logbook-count { justify-self: start; }
  .a49-logbook-workspace { grid-template-columns: 1fr; }
  .a49-logbook-rail { position: static; }
  .a49-logbook-rail-steps {
    grid-template-columns: repeat(2, 1fr); gap: 10px;
  }
  .a49-logbook-bento { grid-template-columns: repeat(2, 1fr); }
  .a49-log-card.order-row:nth-child(even) { transform: none; }
}
@media (max-width: 640px) {
  .a49-log-card.order-row {
    grid-template-columns: 54px 1fr;
    grid-template-areas:
      "rail body"
      "rail action";
  }
  .a49-log-card-rail { grid-area: rail; }
  .a49-log-card-body { grid-area: body; }
  .a49-logbook-view { grid-area: action; justify-self: start; }
  .a49-logbook-bento { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .a49-logbook * { animation: none !important; transition: none !important; }
}
