/* Kompaktowy przycisk PDF i osobna kolumna akcji w tabeli finansowej. */
.finance-table {
  overflow-x: auto;
}

.finance-table-head,
.finance-table article {
  grid-template-columns: minmax(220px, 1.4fr) 105px 105px 145px 110px 115px 180px;
  min-width: 1120px;
}

.invoice-pdf-button {
  justify-self: start;
  display: inline-flex;
  width: auto;
  max-width: 100%;
  min-width: 104px;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 13px;
  border: 1px solid #b8d7cb;
  border-radius: 9px;
  background: #eef8f4;
  color: #145c42;
  box-shadow: 0 1px 2px rgba(15, 76, 57, .08);
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.invoice-pdf-button::before {
  content: "↓";
  display: inline-grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  border-radius: 6px;
  background: #d8eee5;
  color: #145c42;
  font-size: 14px;
  font-weight: 800;
}

.invoice-pdf-button:hover:not(:disabled) {
  border-color: #74b39b;
  background: #e3f3ec;
  box-shadow: 0 4px 10px rgba(15, 76, 57, .12);
  transform: translateY(-1px);
}

.invoice-pdf-button:focus-visible {
  outline: 3px solid rgba(38, 113, 88, .22);
  outline-offset: 2px;
}

.invoice-pdf-button[data-ready="1"] {
  border-color: #155d45;
  background: #155d45;
  color: #fff;
}

.invoice-pdf-button[data-ready="1"]::before {
  content: "↗";
  background: rgba(255, 255, 255, .16);
  color: #fff;
}

.invoice-pdf-button[data-ready="1"]:hover:not(:disabled) {
  border-color: #104c38;
  background: #104c38;
  color: #fff;
}

.invoice-pdf-button.is-loading::before {
  content: "";
  box-sizing: border-box;
  width: 18px;
  height: 18px;
  flex-basis: 18px;
  border: 2px solid rgba(20, 92, 66, .24);
  border-top-color: #145c42;
  border-radius: 50%;
  background: transparent;
  animation: finance-pdf-spin .8s linear infinite;
}

.invoice-pdf-button:disabled {
  cursor: not-allowed;
  opacity: .5;
  box-shadow: none;
  transform: none;
}

.invoice-pdf-button.is-loading:disabled {
  opacity: 1;
}

@keyframes finance-pdf-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .invoice-pdf-button { transition: none; }
  .invoice-pdf-button.is-loading::before { animation: none; }
}
