/* Admin theme overrides.
   Update these tokens to restyle the admin UI without touching public pages. */
body.admin-ui {
  --color-primary: #1D5D4D;
  --color-accent: #F5C2D6;
  --color-rural-cream: #FCFAF2;
  --color-traditional-orange: #F97316;

  --font-display: "Young Serif", "Cooper Black", serif;
  --font-body: "Inter", system-ui, sans-serif;

  --radius-xl: 1.5rem;
  --radius-2xl: 2rem;

  /* Admin-specific tighter spacing */
  --spacing-admin-card: 1.5rem;
  --spacing-admin-section: 2rem;
}

/* Variant row enter / exit animations */
@keyframes variant-row-enter {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes variant-row-exit {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-6px); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
body.admin-ui .variant-row-enter {
  /* transition: none prevents transition-all from racing against the animation */
  transition: none !important;
  animation: variant-row-enter 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}
body.admin-ui .variant-row-exit {
  animation: variant-row-exit 0.18s cubic-bezier(0.55, 0, 1, 0.45) both;
  pointer-events: none;
}
/* Live check-in board: arrivals timeline */
@keyframes bar-grow {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}
@keyframes line-reveal {
  from { clip-path: inset(-8px 100% -8px 0); }
  to   { clip-path: inset(-8px 0 -8px 0); }
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
body.admin-ui .timeline-bar {
  transform-origin: bottom;
  animation: bar-grow 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 12ms);
  /* Morph keeps the node; a changed bar slides to its new height. */
  transition: height 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
body.admin-ui .timeline-bar-now {
  animation: bar-grow 0.45s cubic-bezier(0.22, 1, 0.36, 1) both,
             live-pulse 2.4s ease-in-out 0.5s infinite;
}
body.admin-ui .timeline-line-wrap {
  animation: line-reveal 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}
body.admin-ui .live-dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: #10b981;
  animation: live-pulse 2.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  body.admin-ui .timeline-bar,
  body.admin-ui .timeline-bar-now,
  body.admin-ui .timeline-line-wrap,
  body.admin-ui .live-dot {
    animation: none;
    transition: none;
  }
  body.admin-ui .variant-row-enter,
  body.admin-ui .variant-row-exit {
    animation: none;
    transition: none !important;
  }
  body.admin-ui .stat-card {
    animation: none;
  }
}

/* Dashboard stat cards entrance */
body.admin-ui .stat-card {
  animation: fade-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
body.admin-ui .stat-card:nth-child(1) { animation-delay: 0.05s; }
body.admin-ui .stat-card:nth-child(2) { animation-delay: 0.1s; }

/* SortableJS drag states */
.sortable-ghost {
  opacity: 0.35;
  background: oklch(0.94 0.02 160);
  border-style: dashed;
}
.sortable-chosen {
  cursor: grabbing !important;
  box-shadow: 0 8px 24px -4px oklch(0.35 0.08 160 / 0.2);
}
.sortable-chosen [data-drag-handle] {
  cursor: grabbing !important;
}

/* Hide number input spinners across all browsers */
body.admin-ui input[type="number"]::-webkit-inner-spin-button,
body.admin-ui input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
body.admin-ui input[type="number"] {
  -moz-appearance: textfield;
}

/* Pagy 43 series_nav — house style (work#27 pagination) */
.pagy { display: flex; gap: 0.375rem; align-items: center; font-size: 0.875rem; }
.pagy a { display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; padding: 0 0.625rem; border-radius: 0.75rem; border: 2px solid rgb(29 93 77 / 0.1); color: rgb(29 93 77 / 0.7); font-weight: 700; background: white; }
.pagy a:hover { border-color: rgb(29 93 77 / 0.4); color: rgb(29 93 77); }
.pagy a[aria-current="page"] { background: rgb(29 93 77); border-color: rgb(29 93 77); color: white; }
.pagy a:not([href]):not([aria-current="page"]) { opacity: 0.35; }
.pagy a:not([href]) { pointer-events: none; }

/* Filter selects — house style with a real chevron (Tailwind arbitrary
   bg-url values with spaces don't compile, so this lives here). */
.admin-select { appearance: none; background-color: white; background-repeat: no-repeat; background-position: right 0.6rem center; background-size: 1rem; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%231d5d4d' fill-opacity='0.5'><path fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.06l3.71-3.83a.75.75 0 111.08 1.04l-4.25 4.39a.75.75 0 01-1.08 0L5.21 8.27a.75.75 0 01.02-1.06z' clip-rule='evenodd'/></svg>"); }
