[x-cloak] {
  display: none !important;
}

/* --- Motion tokens -------------------------------------------------------- */
:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 160ms;
  --dur: 280ms;
  --dur-slow: 480ms;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Page enter ------------------------------------------------------------ */
@keyframes ui-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ui-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ui-slide-down {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ui-page {
  animation: ui-fade-up var(--dur-slow) var(--ease-out) both;
}

.ui-rise {
  animation: ui-fade-up var(--dur-slow) var(--ease-out) both;
}

.ui-rise-delay-1 { animation-delay: 60ms; }
.ui-rise-delay-2 { animation-delay: 120ms; }
.ui-rise-delay-3 { animation-delay: 180ms; }
.ui-rise-delay-4 { animation-delay: 240ms; }

.ui-flash {
  animation: ui-slide-down var(--dur) var(--ease-out) both;
}

/* --- Navigation ------------------------------------------------------------ */
.nav-link {
  position: relative;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: #9ca3af;
  transition:
    color var(--dur-fast) ease,
    background-color var(--dur-fast) ease,
    transform var(--dur-fast) var(--ease-out);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.2rem;
  height: 1px;
  background: #d4af37;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur) var(--ease-out);
  opacity: 0.85;
}
.nav-link:hover {
  color: #e5e7eb;
  background-color: rgba(255, 255, 255, 0.04);
}
.nav-link:hover::after,
.nav-link-active::after {
  transform: scaleX(1);
}
.nav-link-active {
  color: #d4af37;
  background-color: rgba(212, 175, 55, 0.06);
}

/* --- Interactive surfaces -------------------------------------------------- */
.ui-panel {
  transition:
    border-color var(--dur) ease,
    box-shadow var(--dur) ease,
    transform var(--dur) var(--ease-out),
    background-color var(--dur) ease;
}
.ui-panel:hover {
  border-color: rgba(212, 175, 55, 0.28);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  transform: translateY(-1px);
}

.ui-btn,
button[type="submit"],
a.rounded-md.bg-gold,
a.rounded-md.border {
  transition:
    background-color var(--dur-fast) ease,
    border-color var(--dur-fast) ease,
    color var(--dur-fast) ease,
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) ease,
    opacity var(--dur-fast) ease;
}
.ui-btn:hover,
button[type="submit"]:hover,
a.rounded-md.bg-gold:hover {
  transform: translateY(-1px);
}
.ui-btn:active,
button[type="submit"]:active,
a.rounded-md.bg-gold:active {
  transform: translateY(0);
}

input,
select,
textarea {
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

/* --- Tables ---------------------------------------------------------------- */
table.dataTable tbody tr {
  transition: background-color var(--dur-fast) ease;
}
table.dataTable tbody tr:hover {
  background-color: rgba(212, 175, 55, 0.04);
}

/* --- Scrollbar ------------------------------------------------------------- */
::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #141417;
}
::-webkit-scrollbar-thumb {
  background: #26262b;
  border-radius: 4px;
  transition: background-color var(--dur-fast) ease;
}
::-webkit-scrollbar-thumb:hover {
  background: #3a3a42;
}

/* --- Typography ------------------------------------------------------------ */
.font-display,
h1,
h2 {
  font-family: "Sora", "Outfit", ui-sans-serif, sans-serif;
  letter-spacing: -0.02em;
}

/* --- Login atmosphere ------------------------------------------------------ */
@keyframes login-glow-drift {
  0% {
    background-position: 0% 0%, 100% 100%, 0 0;
  }
  33% {
    background-position: 28% 18%, 72% 78%, 0 0;
  }
  66% {
    background-position: 8% 42%, 92% 32%, 0 0;
  }
  100% {
    background-position: 0% 0%, 100% 100%, 0 0;
  }
}

@keyframes login-grid-drift {
  0% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-24px, 16px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

.login-shell {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  background-color: #0b0b0d;
  background-image:
    radial-gradient(ellipse 80% 55% at 12% 18%, rgba(212, 175, 55, 0.16), transparent 55%),
    radial-gradient(ellipse 55% 45% at 88% 78%, rgba(212, 175, 55, 0.09), transparent 50%),
    linear-gradient(165deg, #0b0b0d 0%, #121216 48%, #0b0b0d 100%);
  background-size: 140% 140%, 140% 140%, 100% 100%;
  background-repeat: no-repeat;
  animation: login-glow-drift 22s var(--ease-out) infinite;
}
.login-shell::before {
  content: "";
  position: absolute;
  inset: -10%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 30% 40%, black, transparent 75%);
  pointer-events: none;
  animation: login-grid-drift 28s ease-in-out infinite;
}
.login-shell::after {
  content: "";
  position: absolute;
  width: 42vmax;
  height: 42vmax;
  left: -8%;
  top: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.14), transparent 68%);
  filter: blur(8px);
  pointer-events: none;
  animation: login-orb-float 18s ease-in-out infinite;
}
@keyframes login-orb-float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.85; }
  50% { transform: translate3d(18vw, 12vh, 0) scale(1.12); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .login-shell,
  .login-shell::before,
  .login-shell::after {
    animation: none !important;
  }
}

.login-card {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(38, 38, 43, 0.95);
  background: rgba(20, 20, 23, 0.72);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

/* --- Empty states ---------------------------------------------------------- */
.ui-empty {
  border: 1px dashed rgba(38, 38, 43, 0.95);
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(212, 175, 55, 0.07), transparent 70%),
    #141417;
}
