/* =========================================================
   PIVOT - tabella esplorativa + export Excel button
   ========================================================= */

.pivot-section {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 16px 20px;
  margin-top: 16px;
}

.pivot-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.pivot-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-dark);
}

.pivot-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.pivot-controls {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.pivot-dimensions {
  flex: 1;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.pivot-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.pivot-hint {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 4px;
}

/* Bottone export */
.pivot-export-btn {
  background: var(--accent-primary);
  color: var(--on-accent);
  border: none;
  border-radius: 6px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.pivot-export-btn:hover {
  background: var(--accent-dark);
}
.pivot-export-btn:active {
  background: var(--accent-darker);
}

/* Stato loading del bottone export */
.pivot-export-btn.is-loading {
  background: var(--accent-dark);
  cursor: wait;
  position: relative;
  padding-right: 42px;
  pointer-events: none;
}
.pivot-export-btn.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: var(--on-accent);
  border-radius: 50%;
  animation: cai-spin 0.8s linear infinite;
}
