/* Loading states: grey placeholder shapes with a moving shine (skeletons), shown while a page, pop-up or table is
   loading (lib/loading.js). Colours come from the --lb-skeleton-* tokens in theme.css. */
.sk {
  display: block;
  background: linear-gradient(90deg, var(--lb-skeleton-base) 25%, var(--lb-skeleton-shine) 50%, var(--lb-skeleton-base) 75%);
  background-size: 200% 100%;
  border-radius: 8px;
  animation: lb-shimmer 1.3s linear infinite;
}
.sk-line { height: 0.8rem; margin-bottom: 0.65rem; }
.sk-title { height: 1.6rem; width: 14rem; max-width: 60%; margin-bottom: 0.6rem; }
.sk-sub { height: 0.85rem; width: 22rem; max-width: 80%; }
.sk-input { height: 2.25rem; border-radius: var(--lb-radius); }
.sk-btn { height: 2.3rem; width: 7.5rem; border-radius: 999px; }
.sk-avatar { width: 2.2rem; height: 2.2rem; border-radius: 50%; flex: none; }
.sk-w-25 { width: 25%; } .sk-w-40 { width: 40%; } .sk-w-60 { width: 60%; } .sk-w-80 { width: 80%; }

@keyframes lb-shimmer { to { background-position: -200% 0; } }

/* A page while the next one loads: replaces the content area. */
.app-content.is-loading > :not(.lb-page-skeleton) { display: none !important; }
.lb-page-skeleton { animation: lb-fade 0.15s ease; }
.lb-page-skeleton .sk-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; }
.sk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.sk-card { padding: 1.1rem; background: var(--lb-surface); border: 1px solid var(--lb-border-soft); border-radius: var(--lb-radius-lg); }
.sk-card .sk-stat { height: 2rem; width: 45%; margin: 0.4rem 0 0.2rem; }
.sk-row { display: flex; align-items: center; gap: 0.9rem; padding: 0.85rem 0; border-top: 1px solid var(--lb-border-soft); }
.sk-row:first-child { border-top: 0; }
.sk-row .sk-line { margin: 0; flex: 1; }
.sk-row .sk-line.sk-narrow { flex: 0 0 18%; }
.sk-chart { height: 14rem; border-radius: var(--lb-radius); }

/* A pop-up while its form loads (the same dialog the form will fill). */
.lb-modal-skeleton .lb-modal-body { min-height: 16rem; }

/* A button that has been pressed and is waiting for the server: its text stays, a spinner appears beside it. A <button> gets the
   spinner as a pseudo-element; an <input type=submit> can't have one, so it gets the same spinner as a background image. */
.btn.is-busy { position: relative; pointer-events: none; opacity: 0.85; }
.btn.is-busy::after {
  content: "";
  display: inline-block;
  width: 0.9em; height: 0.9em;
  margin-left: 0.55rem;
  vertical-align: -0.12em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: lb-spin 0.7s linear infinite;
}
input.btn.is-busy {
  padding-right: 2.4rem;
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 1rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B2447' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 3a9 9 0 1 1-9 9' opacity='.9'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='0.7s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E");
}
/* On the filled buttons the spinner is white. */
input.btn-primary.is-busy, input.btn-accent.is-busy, input.btn-success.is-busy, input.btn-danger.is-busy {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 3a9 9 0 1 1-9 9'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='0.7s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E");
}
@keyframes lb-spin { to { transform: rotate(360deg); } }

/* The thin bar Turbo shows at the top of the page while it loads. */
.turbo-progress-bar { height: 3px; background: var(--lb-gradient-accent); }

@media (prefers-reduced-motion: reduce) {
  .sk, .btn.is-busy::after { animation-duration: 3s; }
}

/* Attendance pages: the loading shape is the page's own: a table (or calendar) with the counts box at its side. */
.sk-attendance { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 1rem; align-items: start; }
@media (max-width: 991.98px) { .sk-attendance { grid-template-columns: 1fr; } }
.sk-filters { display: flex; gap: 0.6rem; margin-bottom: 1rem; }
.sk-filters .sk-input { width: 11rem; }
.sk-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.sk-calendar .sk { height: 3rem; border-radius: 12px; }
.sk-box-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0; border-top: 1px solid var(--lb-border-soft); }
.sk-box-row:first-child { border-top: 0; }
.sk-box-row .sk-line { margin: 0; }
