.inv-preview-loading-row,
.inv-preview-state-row {
  display: none;
}

.inv-preview-loading-row[hidden],
.inv-preview-state-row[hidden] {
  display: none !important;
}

html.nv-cloudflare-preview-auth body:not([data-preview-dataset="demo"]) .inv-week-timeline,
html.nv-cloudflare-preview-auth body:not([data-preview-dataset="demo"]) .inv-toolbar,
html.nv-cloudflare-preview-auth body:not([data-preview-dataset="demo"]) .inv-toolbar__status,
html.nv-cloudflare-preview-auth body:not([data-preview-dataset="demo"]) .inv-reconciliation,
html.nv-cloudflare-preview-auth body:not([data-preview-dataset="demo"]) .inv-reconciliation__status,
html.nv-cloudflare-preview-auth body:not([data-preview-dataset="demo"]) .inv-bulk-actions,
html.nv-cloudflare-preview-auth body:not([data-preview-dataset="demo"]) [data-inv-doc-panel="quotes"],
html.nv-cloudflare-preview-auth body:not([data-preview-dataset="demo"]) dialog:not(.nv-activation-dialog):not([data-inv-payment-dialog]):not([data-invoice-editor]),
html.nv-cloudflare-preview-auth body:not([data-preview-dataset="demo"]) .inv-payment-source,
html.nv-cloudflare-preview-auth body:not([data-preview-dataset="demo"]) .inv-pagination__pages,
html.nv-cloudflare-preview-auth body:not([data-preview-dataset="demo"]) .inv-pagination__rows {
  display: none !important;
}

html.nv-cloudflare-preview-auth body:not([data-nucleus-invoices-state]) .inv-summary,
html.nv-cloudflare-preview-auth body[data-nucleus-invoices-state="loading"] .inv-summary {
  visibility: visible;
}

html.nv-cloudflare-preview-auth body:not([data-nucleus-invoices-state]) [data-nv-stats="invoicing"] .nv-o-stat__icon,
html.nv-cloudflare-preview-auth body[data-nucleus-invoices-state="loading"] [data-nv-stats="invoicing"] .nv-o-stat__icon,
html.nv-cloudflare-preview-auth body:not([data-nucleus-invoices-state]) :is([data-nv-stats="invoicing"] .nv-o-stat__label, [data-nv-stats="invoicing"] .nv-o-stat__value, [data-nv-stats="invoicing"] .nv-o-stat__meta),
html.nv-cloudflare-preview-auth body[data-nucleus-invoices-state="loading"] :is([data-nv-stats="invoicing"] .nv-o-stat__label, [data-nv-stats="invoicing"] .nv-o-stat__value, [data-nv-stats="invoicing"] .nv-o-stat__meta) {
  color: transparent;
  background: linear-gradient(90deg, var(--dash-surface-hover) 28%, color-mix(in srgb, var(--dash-text) 12%, transparent) 50%, var(--dash-surface-hover) 72%);
  background-size: 220% 100%;
  animation: inv-preview-loading 1.35s ease-in-out infinite;
}

html.nv-cloudflare-preview-auth body:not([data-nucleus-invoices-state]) [data-nv-stats="invoicing"] .nv-o-stat__icon svg,
html.nv-cloudflare-preview-auth body[data-nucleus-invoices-state="loading"] [data-nv-stats="invoicing"] .nv-o-stat__icon svg { opacity: 0; }

html.nv-cloudflare-preview-auth body:not([data-nucleus-invoices-state]) :is([data-nv-stats="invoicing"] .nv-o-stat__label, [data-nv-stats="invoicing"] .nv-o-stat__value, [data-nv-stats="invoicing"] .nv-o-stat__meta),
html.nv-cloudflare-preview-auth body[data-nucleus-invoices-state="loading"] :is([data-nv-stats="invoicing"] .nv-o-stat__label, [data-nv-stats="invoicing"] .nv-o-stat__value, [data-nv-stats="invoicing"] .nv-o-stat__meta) {
  width: fit-content;
  min-width: 44%;
  border-radius: 999px;
}

html.nv-cloudflare-preview-auth body:not([data-nucleus-invoices-state]) [data-nv-stats="invoicing"] .nv-o-stat__value,
html.nv-cloudflare-preview-auth body[data-nucleus-invoices-state="loading"] [data-nv-stats="invoicing"] .nv-o-stat__value { min-width: 32%; }

html.nv-cloudflare-preview-auth body:not([data-nucleus-invoices-state]) [data-nv-stats="invoicing"] .nv-o-stat__meta,
html.nv-cloudflare-preview-auth body[data-nucleus-invoices-state="loading"] [data-nv-stats="invoicing"] .nv-o-stat__meta { min-width: 58%; }

html.nv-cloudflare-preview-auth [data-inv-doc-panel="invoices"] tbody > tr:not(.inv-preview-row):not(.inv-preview-loading-row):not(.inv-preview-state-row) {
  display: none !important;
}

html.nv-cloudflare-preview-auth .inv-preview-loading-row:not([hidden]),
html.nv-cloudflare-preview-auth .inv-preview-state-row:not([hidden]) {
  display: table-row;
}

html.nv-cloudflare-preview-auth .inv-table {
  min-width: 40rem;
}

html.nv-cloudflare-preview-auth .inv-preview-row {
  cursor: default;
}

html.nv-cloudflare-preview-auth .inv-pagination {
  justify-content: flex-start;
}

html.nv-cloudflare-preview-auth .inv-head {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.inv-preview-skeleton {
  display: grid;
}

.inv-preview-skeleton span {
  position: relative;
  overflow: hidden;
  display: block;
  height: 60px;
  border-bottom: 1px solid var(--dash-border);
  background:
    linear-gradient(var(--dash-surface-hover) 0 0) 4% 50% / 9% 9px no-repeat,
    linear-gradient(var(--dash-surface-hover) 0 0) 22% 38% / 16% 9px no-repeat,
    linear-gradient(var(--dash-surface-hover) 0 0) 22% 64% / 10% 7px no-repeat,
    linear-gradient(var(--dash-surface-hover) 0 0) 49% 50% / 11% 9px no-repeat,
    linear-gradient(var(--dash-surface-hover) 0 0) 70% 50% / 9% 9px no-repeat,
    linear-gradient(var(--dash-surface-hover) 0 0) 94% 50% / 8% 9px no-repeat;
}

.inv-preview-skeleton span::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 20%, color-mix(in srgb, var(--dash-text) 8%, transparent) 50%, transparent 80%);
  background-size: 220% 100%;
  animation: inv-preview-loading 1.35s ease-in-out infinite;
}

.inv-preview-skeleton span:last-child {
  border-bottom: 0;
}

.inv-preview-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 56px 24px;
  text-align: center;
}

.inv-preview-state__title,
.inv-preview-state__copy {
  margin: 0;
}

.inv-preview-state__title {
  color: var(--dash-text);
  font-weight: 600;
}

.inv-preview-state__copy {
  max-width: 520px;
  color: var(--dash-text-subtle);
}

@keyframes inv-preview-loading {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .inv-preview-skeleton span::after,
  html.nv-cloudflare-preview-auth body:not([data-nucleus-invoices-state]) .inv-summary :is(.nv-o-stat__icon, .nv-o-stat__label, .nv-o-stat__value, .nv-o-stat__meta),
  html.nv-cloudflare-preview-auth body[data-nucleus-invoices-state="loading"] .inv-summary :is(.nv-o-stat__icon, .nv-o-stat__label, .nv-o-stat__value, .nv-o-stat__meta) { animation: none; }
}

@media (max-width: 560px) {
  html.nv-cloudflare-preview-auth .inv-head {
    align-items: stretch;
    flex-direction: column;
  }
}
