/*
  Spike UI boot screen — skeleton of the app shell shown while the app starts (before Vue mounts: markup
  injected by index.html; after mount until app data is ready: components/AppShellSkeleton.vue).
  Self-contained on purpose: it runs before Vuetify's theme and the app CSS exist, so colours are fixed
  copies of the Spike tokens. Same geometry as the real shell (325px drawer, floating 64px navbar, 24px
  gutter, 20px cards) so the app replaces it in place.
*/
html.ui-spike {
  --sb-bg: #ededf5;
  --sb-navbar: #f9f9fc;
  --sb-card: #fff;
  --sb-line: #e6e6ef;
  --sb-thead: #f9f9fc;
  --sb-bone: rgba(26, 26, 46, 7%);
  --sb-shine: rgba(255, 255, 255, 60%);
  --sb-shadow: 0 1px 2px rgba(15, 23, 42, 4%), 0 8px 28px -10px rgba(15, 23, 42, 12%);
}

html.ui-spike.spike-boot-dark {
  --sb-bg: #0d0c19;
  --sb-navbar: #191830;
  --sb-card: #16152a;
  --sb-line: #29273f;
  --sb-thead: #1b1a31;
  --sb-bone: rgba(232, 232, 242, 7%);
  --sb-shine: rgba(255, 255, 255, 5%);
  --sb-shadow: 0 10px 28px -12px rgba(0, 0, 0, 60%);
}

@keyframes spike-boot-shimmer {
  from {
    background-position: 100% 0;
  }

  to {
    background-position: -100% 0;
  }
}

.spike-boot {
  position: fixed;
  z-index: 1;
  display: flex;
  background: var(--sb-bg);
  inset: 0;
}

.spike-boot__bone {
  display: block;
  border-radius: 999px;
  animation: spike-boot-shimmer 1.4s linear infinite;
  background: linear-gradient(90deg, transparent 30%, var(--sb-shine) 50%, transparent 70%) 0 0 / 200% 100%, var(--sb-bone);
  block-size: 12px;
  inline-size: 100%;
}

.spike-boot__bone--title {
  block-size: 20px;
  inline-size: 120px;
}

.spike-boot__bone--pill {
  block-size: 26px;
  inline-size: 44px;
}

.spike-boot__bone--icon {
  flex-shrink: 0;
  border-radius: 6px;
  block-size: 20px;
  inline-size: 20px;
}

.spike-boot__bone--search {
  block-size: 34px;
  inline-size: 240px;
}

.spike-boot__bone--circle {
  block-size: 34px;
  inline-size: 34px;
}

.spike-boot__bone--h1 {
  block-size: 22px;
  inline-size: 220px;
}

.spike-boot__bone--sub {
  inline-size: 320px;
}

.spike-boot__bone--line-md {
  inline-size: 160px;
}

.spike-boot__bone--line-sm {
  block-size: 10px;
  inline-size: 110px;
}

.spike-boot__bone--btn {
  border-radius: 10px;
  block-size: 34px;
  inline-size: 140px;
}

.spike-boot__bone--field {
  border-radius: 10px;
  block-size: 36px;
}

.spike-boot__bone--th {
  block-size: 10px;
  inline-size: 60%;
}

.spike-boot__nav {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  background:
    radial-gradient(360px 300px at 100% 0%, rgba(99, 102, 241, 45%), transparent 70%),
    linear-gradient(170deg, #312e81 0%, #1e1b4b 55%, #0f0d2e 100%);
  border-end-end-radius: 24px;
  border-start-end-radius: 24px;
  gap: 14px;
  inline-size: 325px;
  padding-block: 22px;
  padding-inline: 23px 20px;
}

/* Bones on the indigo drawer */
.spike-boot__nav .spike-boot__bone {
  background: linear-gradient(90deg, transparent 30%, rgba(255, 255, 255, 12%) 50%, transparent 70%) 0 0 / 200% 100%, rgba(255, 255, 255, 12%);
}

.spike-boot__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-block-end: 14px;
}

.spike-boot__nav-item {
  display: flex;
  align-items: center;
  block-size: 26px;
  gap: 12px;
}

.spike-boot__main {
  display: flex;
  overflow: hidden;
  flex-direction: column;
  flex-grow: 1;
  gap: 24px;
  padding-block: 18px;
  padding-inline: 24px;
}

.spike-boot__navbar {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--sb-line);
  border-radius: 20px;
  background: var(--sb-navbar);
  block-size: 64px;
  box-shadow: var(--sb-shadow);
  padding-inline: 18px;
}

.spike-boot__navbar-actions {
  display: flex;
  gap: 8px;
}

.spike-boot__heading {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-block-start: 6px;
}

.spike-boot__card {
  padding: 20px;
  border: 1px solid var(--sb-line);
  border-radius: 20px;
  background: var(--sb-card);
  box-shadow: var(--sb-shadow);
}

.spike-boot__card--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.spike-boot__stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spike-boot__grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(6, 1fr);
}

.spike-boot__card--table {
  overflow: hidden;
  flex-grow: 1;
  padding: 0;
}

.spike-boot__thead,
.spike-boot__tr {
  display: grid;
  align-items: center;
  border-block-end: 1px solid var(--sb-line);
  gap: 24px;
  grid-template-columns: repeat(6, 1fr);
  padding-inline: 18px;
}

.spike-boot__thead {
  background: var(--sb-thead);
  block-size: 44px;
}

.spike-boot__tr {
  block-size: 52px;
}

@media (max-width: 1279px) {
  .spike-boot__nav {
    display: none;
  }

  .spike-boot__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 599px) {
  .spike-boot__main {
    padding-inline: 16px;
  }

  .spike-boot__bone--search,
  .spike-boot__bone--sub {
    inline-size: 50%;
  }

  .spike-boot__navbar-actions {
    gap: 4px;
  }

  .spike-boot__bone--circle {
    block-size: 28px;
    inline-size: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spike-boot__bone {
    animation: none;
  }
}

html.ui-spike.spike-boot-dark .spike-boot__nav {
  background:
    radial-gradient(360px 300px at 100% 0%, rgba(99, 102, 241, 22%), transparent 70%),
    linear-gradient(170deg, #22204a 0%, #17153a 55%, #0f0e24 100%);
}
